fix: 管理会话自动恢复与访问来源统计优化
- 新增 AdminSessionRecover:后台离线/后端重启时自动重试恢复会话,明确失效才回跳登录 - 认证 cookie 契约调整(SameSite=Lax 与刷新轮转适配),路由与守卫适配 - 访问来源统计查询优化与测试、管理端 analytics sources 页面适配 - 移动端布局修正:覆盖 body min-h-screen 避免内容区高度异常
This commit is contained in:
@@ -726,7 +726,7 @@ function detectBannedBody(res: Response): void {
|
||||
// 调用 /api/auth/refresh 刷新 access token(refresh cookie 由浏览器自动携带)。
|
||||
// transient=true 表示网络异常或后端暂不可用(含代理 5xx):此时无法证明登录态
|
||||
// 失效,调用方不应据此弹"登录已失效"——dev 后端 go run 重启窗口内尤其常见
|
||||
async function apiRefresh(): Promise<{ ok: boolean; banned: boolean; transient: boolean }> {
|
||||
export async function apiRefresh(): Promise<{ ok: boolean; banned: boolean; transient: boolean }> {
|
||||
try {
|
||||
const res = await fetch("/api/auth/refresh", {
|
||||
method: "POST",
|
||||
@@ -1748,7 +1748,7 @@ export interface VisitSourcesKindDay {
|
||||
export interface VisitSources {
|
||||
range_days: number;
|
||||
kinds: VisitNamedCount[];
|
||||
search_hosts: VisitNamedCount[];
|
||||
search_terms: VisitNamedCount[];
|
||||
external: VisitNamedCount[];
|
||||
trend: VisitSourcesKindDay[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user