fix(web): 避免刷新时闪现未登录页面
统一认证会话需要异步恢复,首次渲染不能把尚未确认的状态当作未登录。新增 checking、authenticated、unauthenticated 三态鉴权,在检查期间显示中性加载状态并隐藏登录相关操作。 验证:前端 156 项测试通过;TypeScript 类型检查、lint、生产构建和浏览器刷新验收通过。
This commit is contained in:
@@ -197,6 +197,31 @@
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
.authSessionChecking {
|
||||
align-items: center;
|
||||
color: var(--muted-foreground);
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
justify-content: center;
|
||||
min-height: calc(100vh - 160px);
|
||||
}
|
||||
|
||||
.authSessionChecking svg {
|
||||
animation: auth-session-spin 0.9s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes auth-session-spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.authSessionChecking svg {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 980px) {
|
||||
.landingHero,
|
||||
.loginRequiredPage {
|
||||
|
||||
Reference in New Issue
Block a user