diff --git a/src/router/index.ts b/src/router/index.ts index 82f75da086c4dc0eebc3abb3dafb778f4b7acd9d..2dd61bf2e71c749ffdd5d1a95253b9270b8a25f5 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -38,28 +38,24 @@ const router = createRouter({ name: 'api', component: (): Promise => import('src/views/api/index.vue'), - meta: { requiresAuth: true } // 标记需要登录的页面 }, { path: '/app', name: 'app', component: (): Promise => import('src/views/app/index.vue'), - meta: { requiresAuth: true } // 标记需要登录的页面 }, { path: '/createApp', name: 'createApp', component: (): Promise => import('src/views/createapp/index.vue'), - meta: { requiresAuth: true } // 标记需要登录的页面 }, { path: '/witchainD', name: 'witchainD', component: (): Promise => import('src/views/tools/index.vue'), - meta: { requiresAuth: true } // 标记需要登录的页面 }, { path: '/404', @@ -73,14 +69,4 @@ const router = createRouter({ ], }); -router.beforeEach((to, from, next) => { - const {userinfo} = useAccountStore(); - // 检查是否需要登录 - if (to.meta.requiresAuth && !userinfo.user_sub) { - next('/'); // 未登录时跳转首页 - } else { - next(); - } -}) - export default router;