Skip to content

Commit

Permalink
perf: 网络连接时 500 自动跳转到主页
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanzhaoyu committed Mar 22, 2023
1 parent 814c3a2 commit 5fee113
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/router/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export function setupPageGuard(router: Router) {
const data = await authStore.getSession()
if (String(data.auth) === 'false' && authStore.token)
authStore.removeToken()
next()
if (to.path === '/500')
next({ name: 'Root' })
else
next()
}
catch (error) {
if (to.path !== '/500')
Expand Down

0 comments on commit 5fee113

Please sign in to comment.