perf(frontend,config): parallelize auth, virtualize logs, cache public configs

Frontend layout renders immediately; pages gate via RequireAuth and
useAuthRedirect. Login/register skip getUserInfo. Admin log panel uses
useVirtualizer to avoid 2000-row DOM. ListVisibleSystemConfigs caches
visibility=1 configs in Redis with invalidation on create/update.
PERFORMANCE.md marks completed optimizations.
This commit is contained in:
ryan
2026-06-17 11:41:24 +08:00
parent 6a8f9a7aea
commit ca21e0eca7
13 changed files with 427 additions and 165 deletions
+10 -1
View File
@@ -103,9 +103,18 @@ export function UserProvider({ children }: { children: ReactNode }) {
}
}, [])
/** 组件挂载时获取用户信息 */
/** 组件挂载时获取用户信息(登录/注册页跳过,避免无意义请求) */
useEffect(() => {
isMountedRef.current = true
const path = window.location.pathname
if (path === "/login" || path === "/register") {
setState({user: null, loading: false, error: null})
return () => {
isMountedRef.current = false
}
}
fetchUser()
return () => {