fix(creator): 权限开通后的状态显示 + 同步范围可选可查
Deploy VitePress site to Pages / build (push) Canceled after 0s
Deploy VitePress site to Pages / Deploy (push) Canceled after 0s

- 权限显示:实测今天 display/status 已变成 1,但 tip 是「数据正在更新中,请耐心等待」,
  作品仍是 0 条。原逻辑只在未开通时显示提示条,于是会一边写着「数据已开通」一边列不出
  作品,自相矛盾。现在只要后台有话要说就显示,并按状态区分措辞。
- 同步范围:原本写死 90 天,界面上既看不见也改不了。现在可选 7/30/90/180/365/730 天,
  与后端校验上限一致。
- 新增 creator_account.last_sync_days,记录上次实际使用的范围 —— 否则界面只能说
  「同步过了」,说不清覆盖的是哪一段。选择器也会对齐到它,避免上次同步 1 年、这次
  点一下悄悄缩回 90 天。
This commit is contained in:
2026-10-08 07:52:28 +08:00
parent bef0a4fbde
commit fa227600fe
4 changed files with 79 additions and 11 deletions
+3
View File
@@ -64,6 +64,7 @@ def _account_dict(account: CreatorAccount, note_count: int = 0) -> Dict[str, Any
"permission_tip": account.permission_tip,
"last_checked_at": account.last_checked_at,
"last_synced_at": account.last_synced_at,
"last_sync_days": account.last_sync_days,
"last_error": account.last_error,
"has_cookie": bool(account.cookie),
"created_at": account.created_at,
@@ -344,6 +345,7 @@ async def sync_account(
)
account.last_synced_at = now
account.last_sync_days = days
account.last_error = None
account.updated_at = now
await refresh_permission(session, account)
@@ -352,6 +354,7 @@ async def sync_account(
return {
"account_id": account_id,
"fetched": len(collected),
"days": days,
"permission_status": account.permission_status,
"permission_tip": account.permission_tip,
}