32 lines
900 B
Python
32 lines
900 B
Python
from main import punch
|
|
import requests
|
|
|
|
def debug_punch(attendance_id: str, token: str) -> None:
|
|
"""
|
|
调试打卡功能的函数
|
|
|
|
Args:
|
|
attendance_id: 考勤ID
|
|
token: 用户认证令牌
|
|
"""
|
|
print(f"开始调试打卡功能...")
|
|
print(f"Attendance ID: {attendance_id}")
|
|
print(f"Token: {token}")
|
|
|
|
try:
|
|
# 调用main.py中的punch函数发送打卡请求
|
|
response = punch(attendance_id, token)
|
|
|
|
print(f"请求状态码: {response.status_code}")
|
|
print(f"响应内容: {response.text}")
|
|
|
|
if response.status_code == 200:
|
|
print("打卡成功!")
|
|
else:
|
|
print("打卡失败!")
|
|
|
|
except Exception as e:
|
|
print(f"发生异常: {e}")
|
|
|
|
# 使用示例 (请替换为实际的值进行测试)
|
|
# debug_punch("your_attendance_id_here", "your_token_here") |