fix: 凭据有效改为当场取到个人信息和本月学时
This commit is contained in:
@@ -665,6 +665,8 @@ def _refresh_one(employee_id: str, attempts: int, client_factory) -> None:
|
||||
valid = False
|
||||
checked_alive = False
|
||||
hours = ""
|
||||
official = ""
|
||||
profile: dict = {}
|
||||
try:
|
||||
from euniv.proxy_pool import MAX_SWITCHES
|
||||
|
||||
@@ -709,7 +711,14 @@ def _refresh_one(employee_id: str, attempts: int, client_factory) -> None:
|
||||
_persist(db, employee_id, password, client, profile)
|
||||
valid = True
|
||||
if valid:
|
||||
hours = _month_hours(client)
|
||||
from admin.users import describe_credential
|
||||
|
||||
found = describe_credential(client)
|
||||
hours = found["hours"]
|
||||
official = found["official"]
|
||||
profile = found["profile"]
|
||||
valid = bool(found["valid"])
|
||||
checked_alive = valid
|
||||
break
|
||||
except Exception as exc:
|
||||
if _switch_proxy(account, client, exc):
|
||||
@@ -742,10 +751,14 @@ def _refresh_one(employee_id: str, attempts: int, client_factory) -> None:
|
||||
except Exception:
|
||||
pass
|
||||
record_outcome(account, valid)
|
||||
if profile:
|
||||
_remember_profile(db, employee_id, profile)
|
||||
if hours:
|
||||
from euniv.study_control import stamp_hours
|
||||
|
||||
stamp_hours(account, hours)
|
||||
if official:
|
||||
account.official_month_hours = official[:32]
|
||||
db.commit()
|
||||
if valid is True:
|
||||
from euniv.autostudy import request_wake
|
||||
|
||||
Reference in New Issue
Block a user