✨ feat: 修改temp页面结构和路由,修复聊天框
This commit is contained in:
@@ -85,14 +85,25 @@ export const constantRoutes = [
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'temp',
|
||||
component: () => import('@/views/temp'),
|
||||
name: 'Temp',
|
||||
meta: { title: '临时页面', icon: 'dashboard', affix: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/temp',
|
||||
component: () => import('@/views/temp'),
|
||||
name: 'Temp',
|
||||
meta: { title: '临时页面', icon: 'dashboard', affix: true },
|
||||
beforeEnter: (to, from, next) => {
|
||||
// 从本地存储获取角色信息
|
||||
currentRole().then(res => {
|
||||
const role = res.data.roleKey;
|
||||
if (role === 'temp') {
|
||||
next()
|
||||
} else {
|
||||
next('/index') // 重定向到工作台
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/tool',
|
||||
component: Layout,
|
||||
|
||||
Reference in New Issue
Block a user