We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0cccd04 + 25692f8 commit 436faabCopy full SHA for 436faab
src/router/permission.ts
@@ -2,7 +2,7 @@ import type { Router } from 'vue-router'
2
import { useAuthStoreWithout } from '@/store/modules/auth'
3
4
export function setupPageGuard(router: Router) {
5
- router.beforeEach(async (from, to, next) => {
+ router.beforeEach(async (to, from, next) => {
6
const authStore = useAuthStoreWithout()
7
if (!authStore.session) {
8
try {
@@ -12,7 +12,7 @@ export function setupPageGuard(router: Router) {
12
next()
13
}
14
catch (error) {
15
- if (from.path !== '/500')
+ if (to.path !== '/500')
16
next({ name: '500' })
17
else
18
0 commit comments