fix: 推送按序号只保留最新一帧,倒计时改用剩余秒数

This commit is contained in:
2026-11-16 09:38:07 +08:00
parent f20cf79e57
commit 556121a265
6 changed files with 57 additions and 30 deletions
+1 -10
View File
@@ -30,7 +30,6 @@ from euniv.models import Account
from euniv.login_limit import allow as login_allowed
from euniv.service import (
fetch_exam_detail,
fetch_home,
fetch_home_exams,
fetch_home_summary,
fetch_home_trainings,
@@ -287,14 +286,6 @@ def _signed_in(request: Request, db: Session) -> str:
return employee_id
@app.get("/api/home")
def home(request: Request, db: Session = Depends(get_db)) -> dict:
try:
return fetch_home(db, _signed_in(request, db))
except RuntimeError as exc:
raise HTTPException(status_code=400, detail=str(exc)) from exc
@app.get("/api/home/summary")
def home_summary(request: Request, db: Session = Depends(get_db)) -> dict:
try:
@@ -455,7 +446,7 @@ def get_study_control(request: Request, db: Session = Depends(get_db)) -> dict:
live = dict((status.get("users") or {}).get(employee_id) or {})
if settle(account, live):
db.commit()
return assemble(account, live)
return stamp_frame(employee_id, assemble(account, live))
@app.post("/api/settings/study-control")