fix: 推送按序号只保留最新一帧,倒计时改用剩余秒数
This commit is contained in:
+1
-10
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user