This commit is contained in:
Zyronon
2025-11-14 02:00:21 +08:00
parent 0441302f88
commit 066686f024
14 changed files with 581 additions and 389 deletions

View File

@@ -12,6 +12,7 @@ import BookList from "@/pages/article/BookList.vue";
import Setting from "@/pages/setting/Setting.vue";
import Login from "@/pages/user/login.vue";
import User from "@/pages/user/User.vue";
import VipIntro from "@/pages/user/VipIntro.vue";
// import { useAuthStore } from "@/stores/auth.ts";
export const routes: RouteRecordRaw[] = [
@@ -36,6 +37,7 @@ export const routes: RouteRecordRaw[] = [
{path: 'setting', component: Setting},
{path: 'login', component: Login},
{path: 'user', component: User},
{path: 'vip', component: VipIntro},
]
},
{path: '/batch-edit-article', component: () => import("@/pages/article/BatchEditArticlePage.vue")},
@@ -61,7 +63,7 @@ const router = VueRouter.createRouter({
router.beforeEach(async (to: any, from: any) => {
return true
// const authStore = useAuthStore()
// const userStore = useAuthStore()
//
// // 公共路由,不需要登录验证
// const publicRoutes = ['/login', '/wechat/callback', '/user-agreement', '/privacy-policy']
@@ -72,9 +74,9 @@ router.beforeEach(async (to: any, from: any) => {
// }
//
// // 如果用户未登录,跳转到登录页
// if (!authStore.isLoggedIn) {
// if (!userStore.isLoggedIn) {
// // 尝试初始化认证状态
// const isInitialized = await authStore.initAuth()
// const isInitialized = await userStore.initAuth()
// if (!isInitialized) {
// return {path: '/login', query: {redirect: to.fullPath}}
// }