feat(admin-web): proactively refresh access tokens before expiry

Track access token expires_at, dedupe concurrent refreshes, retry SSE on
401, and refresh on window focus/visibility so long-lived sessions stop
hitting the login redirect mid-task.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-25 16:48:15 +08:00
parent 4f3c39f5f5
commit 19527cdf42
6 changed files with 218 additions and 26 deletions
+1
View File
@@ -4,6 +4,7 @@ const errorMessageMap: Record<string, string> = {
invalid_credentials: "邮箱或密码错误",
no_tenant: "当前账号未关联租户",
not_authenticated: "请先登录",
missing_bearer_token: "请先登录",
invalid_access_token: "登录状态已失效",
invalid_refresh_token: "刷新令牌已失效",
refresh_session_expired: "登录已过期,请重新登录",