From 4e6f18dfa08e2f2f4f02aaa1b8e8e51852b7a9a1 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期五, 13 三月 2026 17:46:03 +0800
Subject: [PATCH] 考点核验
---
src/router/index.js | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/router/index.js b/src/router/index.js
index 82fc678..3b466f4 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -2,13 +2,16 @@
import authPage from '@/router/auth/index.js'
import errorPage from '@/router/error/index.js'
import mainPage from '@/router/main/index.js'
+import h5 from '@/router/h5/router.js'
+import { useLoginStore } from '@/stores/login.js'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
- routes: [...mainPage, ...authPage, ...errorPage],
+ routes: [...mainPage, ...authPage, ...errorPage, ...h5],
})
router.beforeEach((to, from, next) => {
+ const { setLastRouteInfo } = useLoginStore()
if (!to.matched.length) {
if (to.path === '/') {
next({ path: '/main/home' })
@@ -16,6 +19,9 @@
next({ path: '/error/404', query: { errorUrl: to.path } })
}
} else {
+ if (from.name) {
+ setLastRouteInfo(from)
+ }
next()
}
})
--
Gitblit v1.8.0