Skip to content

Commit 5fee113

Browse files
committed
perf: 网络连接时 500 自动跳转到主页
1 parent 814c3a2 commit 5fee113

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/router/permission.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ export function setupPageGuard(router: Router) {
99
const data = await authStore.getSession()
1010
if (String(data.auth) === 'false' && authStore.token)
1111
authStore.removeToken()
12-
next()
12+
if (to.path === '/500')
13+
next({ name: 'Root' })
14+
else
15+
next()
1316
}
1417
catch (error) {
1518
if (to.path !== '/500')

0 commit comments

Comments
 (0)