Skip to content

Commit 25692f8

Browse files
authored
fix: inverted parameter for before each function (#585)
1 parent 3a1466b commit 25692f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/router/permission.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Router } from 'vue-router'
22
import { useAuthStoreWithout } from '@/store/modules/auth'
33

44
export function setupPageGuard(router: Router) {
5-
router.beforeEach(async (from, to, next) => {
5+
router.beforeEach(async (to, from, next) => {
66
const authStore = useAuthStoreWithout()
77
if (!authStore.session) {
88
try {
@@ -12,7 +12,7 @@ export function setupPageGuard(router: Router) {
1212
next()
1313
}
1414
catch (error) {
15-
if (from.path !== '/500')
15+
if (to.path !== '/500')
1616
next({ name: '500' })
1717
else
1818
next()

0 commit comments

Comments
 (0)