diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index a42cd8c..fc5e74a 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -5,7 +5,7 @@ import { useUserStore } from '@/store/user' const routes:any = [ { path: '/', - redirect: '/UserNavbar' + redirect: '/AppFrame' }, // 登录页面路由配置 { @@ -118,11 +118,11 @@ const routes:any = [ } }, { - path: '/UserNavbar', - name: 'UserNavbar', + path: '/AppFrame', + name: 'AppFrame', component: () => import('@/views/system/userlogin/appframe_container.vue'), meta: { - title: '导航', + title: '首页', requiresAuth: true } } @@ -149,7 +149,7 @@ router.beforeEach((to, from, next) => { } else { // 如果已登录且访问登录页,重定向到仪表板 if (to.path === '/UserLogin' && userStore.isAuthenticated) { - next('/UserNavbar') + next('/AppFrame') } else { next() } diff --git a/frontend/src/views/system/userlogin/login.vue b/frontend/src/views/system/userlogin/login.vue index 054c545..ed711e8 100644 --- a/frontend/src/views/system/userlogin/login.vue +++ b/frontend/src/views/system/userlogin/login.vue @@ -57,7 +57,7 @@ const submitForm = async (formEl: FormInstance | undefined) => { localStorage.setItem('permissions', JSON.stringify(res.data.permissions)) ElMessage.success('登录成功') router.push({ - path: '/UserNavbar', + path: '/AppFrame', }) }else{ errormsg.value = res.msg