|
@@ -112,12 +112,13 @@ export class App implements OnInit {
|
|
|
console.log('[AUTH] 从 localStorage 恢复用户:', cachedUserId);
|
|
console.log('[AUTH] 从 localStorage 恢复用户:', cachedUserId);
|
|
|
this.userId = cachedUserId;
|
|
this.userId = cachedUserId;
|
|
|
this.loggedInUser = cachedUserId;
|
|
this.loggedInUser = cachedUserId;
|
|
|
|
|
+ // 后台验证 token 是否还有效
|
|
|
|
|
+ this.validateCachedToken(cachedToken, cachedUserId);
|
|
|
if (this.apigId) {
|
|
if (this.apigId) {
|
|
|
this.loadApig();
|
|
this.loadApig();
|
|
|
- // 后台验证 token 是否还有效
|
|
|
|
|
- this.validateCachedToken(cachedToken, cachedUserId);
|
|
|
|
|
- return;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ // 即使没有 apigId,也不需要重新登录(模板会显示友好提示)
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 3. 什么都没有 → 显示登录弹窗
|
|
// 3. 什么都没有 → 显示登录弹窗
|