feat: 修改temp页面结构和路由,修复聊天框

This commit is contained in:
2025-03-07 14:45:30 +08:00
parent c70a3de1ca
commit 8223e2aa3e
5 changed files with 151 additions and 30 deletions

View File

@@ -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,