Skip to content

Commit

Permalink
Merge pull request #13 from Chanzhaoyu/main
Browse files Browse the repository at this point in the history
fix: inverted parameter for before each function (Chanzhaoyu#585)
  • Loading branch information
nuoooo committed Mar 16, 2023
2 parents 28856be + 25692f8 commit ae39a2c
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 ae39a2c

Please sign in to comment.