Skip to content

Commit

Permalink
fix: inverted parameter for before each function (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdsuwwz authored Mar 15, 2023
1 parent 3a1466b commit 25692f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/router/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Router } from 'vue-router'
import { useAuthStoreWithout } from '@/store/modules/auth'

export function setupPageGuard(router: Router) {
router.beforeEach(async (from, to, next) => {
router.beforeEach(async (to, from, next) => {
const authStore = useAuthStoreWithout()
if (!authStore.session) {
try {
Expand All @@ -12,7 +12,7 @@ export function setupPageGuard(router: Router) {
next()
}
catch (error) {
if (from.path !== '/500')
if (to.path !== '/500')
next({ name: '500' })
else
next()
Expand Down

0 comments on commit 25692f8

Please sign in to comment.