feat: 接入真实平台登录态
- login/session: 对接后端登录、鉴权恢复和首次改密 - api/store: 恢复 BPMN XML 真实接口并携带 Bearer token - layout/settings: 展示真实角色、审计 JSON 和通知平台配置文档
This commit is contained in:
+4
-3
@@ -60,10 +60,11 @@ const router = createRouter({
|
||||
routes,
|
||||
})
|
||||
|
||||
router.beforeEach((to) => {
|
||||
router.beforeEach(async (to) => {
|
||||
const session = useSessionStore()
|
||||
const authenticated = await session.bootstrap()
|
||||
|
||||
if (!to.meta.public && !session.isAuthenticated) {
|
||||
if (!to.meta.public && (!authenticated || session.mustChangePassword)) {
|
||||
return {
|
||||
name: 'login',
|
||||
query: {
|
||||
@@ -72,7 +73,7 @@ router.beforeEach((to) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (to.name === 'login' && session.isAuthenticated) {
|
||||
if (to.name === 'login' && authenticated && !session.mustChangePassword) {
|
||||
return {
|
||||
name: 'overview',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user