Files
python----/智慧校园/本地/api.py
T
admin 2d8c1ea8f9 chore: 批量新增各类工具脚本与配置文件
1. 新增音频录制、下载、上传相关脚本
2. 新增数据库操作、API调用工具
3. 新增Excel数据处理脚本
4. 新增弱密码检测脚本
2026-06-14 17:47:15 +08:00

36 lines
1.3 KiB
Python

from requests import get, post
import time
ip = "http://192.168.0.209:8100"
param = {
"username": "zhongwei",
"password": "123456a",
"client_id": "client",
"grant_type": "password",
"client_secret": "123456",
}
data = get(url=f"{ip}/oauth/token", params=param).json()
token = data["access_token"]
header = {
"content-type": "application/json",
"authorization": f"Bearer {token}",
}
teamId = 110
year = 2026
month = 3
data1 = get(f"{ip}/classAttend/screen/summary", headers=header, params={"teamId": teamId, "year": year, "month": month}).text
print("summary:", data1, end="\n\n")
data2 = get(f"{ip}/classAttend/screen/dailyTrend", headers=header, params={"teamId": teamId, "year": year, "month": month}).text
print("dailyTrend:", data2, end="\n\n")
data3 = get(f"{ip}/classAttend/screen/statusPie", headers=header, params={"teamId": teamId, "year": year, "month": month}).text
print("statusPie:", data3, end="\n\n")
data4 = get(f"{ip}/classAttend/screen/gradeRanking", headers=header, params={"teamId": teamId, "year": year, "month": month}).text
print("gradeRanking:", data4, end="\n\n")
data5 = get(f"{ip}/classAttend/screen/studentRanking", headers=header, params={"teamId": teamId, "year": year, "month": month}).text
print("studentRanking:", data5, end="\n\n")