修改
This commit is contained in:
parent
9cd6f5ab07
commit
a236819f94
@ -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()
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user