🐛 问题描述 | Bug Description
JWT 令牌失效后,系统没有做路由守卫判断,导致网盘页面加载数据时显示 undefined,页面展现异常。
When the JWT token expires, there is no route guard to intercept and handle it, causing the cloud drive page to render undefined values when fetching data — the page breaks visually.
📸 截图 | Screenshot

(用户提供的截图显示 JWT 过期后网盘页面数据全部为 undefined)
🎯 复现步骤 | Steps to Reproduce
-
登录系统后等待 JWT 过期(或手动清除本地 Token)
-
访问网盘页面
-
页面加载时请求接口失败(401),但前端没有兜底处理
-
页面上数据展示区域显示 undefined
-
无任何跳转回登录页或提示用户重新登录
-
Log in and wait for JWT to expire (or manually clear the local token)
-
Navigate to the cloud drive page
-
API calls fail with 401, but the frontend has no fallback handling
-
Data display areas show undefined
-
No redirect to login page or prompt to re-authenticate
✅ 预期行为 | Expected Behavior
- JWT 过期后,路由守卫应拦截未授权请求
- 自动跳转到登录页,或弹出提示并引导用户重新登录
- 不应显示
undefined 或其他无意义的数据
- The route guard should intercept unauthorized requests when JWT expires
- Automatically redirect to the login page, or prompt the user to re-authenticate
- Should NOT display
undefined or any meaningless data
🛠️ 技术方案建议 | Suggested Fix
-
在路由配置中添加全局路由守卫(Navigation Guard):
- 每次路由跳转前检查 JWT 是否有效(解码检查过期时间,或调一个轻量验证接口)
- JWT 过期/无效时拦截跳转,重定向到登录页
-
在 API 请求拦截器(Axios/Fetch interceptor)中也做统一处理:
- 收到 401 响应时清除本地 Token 并跳转登录页
-
页面组件中防止数据为 undefined 时直接渲染,添加兜底/占位 UI
-
Add a global Navigation Guard in the router config:
- Check JWT validity before each route change (decode and check expiry, or call a lightweight verification endpoint)
- Redirect to login page if JWT is expired/invalid
-
Also handle in the API request interceptor (Axios/Fetch):
- On 401 response, clear local token and redirect to login
-
Prevent rendering undefined values in page components — add fallback/placeholder UI
🏷️ 优先级 | Priority
P1 — Bug 修复 (Bug Fix)
🐛 问题描述 | Bug Description
JWT 令牌失效后,系统没有做路由守卫判断,导致网盘页面加载数据时显示
undefined,页面展现异常。When the JWT token expires, there is no route guard to intercept and handle it, causing the cloud drive page to render
undefinedvalues when fetching data — the page breaks visually.📸 截图 | Screenshot
(用户提供的截图显示 JWT 过期后网盘页面数据全部为 undefined)
🎯 复现步骤 | Steps to Reproduce
登录系统后等待 JWT 过期(或手动清除本地 Token)
访问网盘页面
页面加载时请求接口失败(401),但前端没有兜底处理
页面上数据展示区域显示
undefined无任何跳转回登录页或提示用户重新登录
Log in and wait for JWT to expire (or manually clear the local token)
Navigate to the cloud drive page
API calls fail with 401, but the frontend has no fallback handling
Data display areas show
undefinedNo redirect to login page or prompt to re-authenticate
✅ 预期行为 | Expected Behavior
undefined或其他无意义的数据undefinedor any meaningless data🛠️ 技术方案建议 | Suggested Fix
在路由配置中添加全局路由守卫(Navigation Guard):
在 API 请求拦截器(Axios/Fetch interceptor)中也做统一处理:
页面组件中防止数据为
undefined时直接渲染,添加兜底/占位 UIAdd a global Navigation Guard in the router config:
Also handle in the API request interceptor (Axios/Fetch):
Prevent rendering
undefinedvalues in page components — add fallback/placeholder UI🏷️ 优先级 | Priority
P1 — Bug 修复 (Bug Fix)