mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-07-21 11:57:47 +00:00
fix: inverted parameter for before each function (#585)
This commit is contained in:
@@ -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 {
|
||||
@@ -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()
|
||||
|
Reference in New Issue
Block a user