Skip to content

Commit

Permalink
fix: inverted parameter for before each function (Chanzhaoyu#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdsuwwz authored and jingChen55 committed Mar 27, 2023
1 parent 545c259 commit f911a3e
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 f911a3e

Please sign in to comment.