From a986a8d6fb5e44f7044469f5f420ce0d7b5bf235 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 26 十一月 2025 11:36:02 +0800
Subject: [PATCH] 11
---
src/permission.ts | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/src/permission.ts b/src/permission.ts
index 7f20ed4..d0bfdfd 100644
--- a/src/permission.ts
+++ b/src/permission.ts
@@ -6,8 +6,10 @@
import { useNProgress } from '@/hooks/web/useNProgress'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { useDictStoreWithOut } from '@/store/modules/dict'
+import { useCheckTypeStoreWithOut } from '@/store/modules/checkType'
import { useUserStoreWithOut } from '@/store/modules/user'
import { usePermissionStoreWithOut } from '@/store/modules/permission'
+import { useRoomStoreWithOut } from "@/store/modules/room";
const { start, done } = useNProgress()
@@ -53,7 +55,9 @@
'/auth-redirect',
'/bind',
'/register',
- '/oauthLogin/gitee'
+ '/oauthLogin/gitee',
+ '/calling-screen-big',
+ '/calling-screen-room'
]
// 璺敱鍔犺浇鍓�
@@ -61,14 +65,15 @@
console.info("router.beforeEach to: " + to.fullPath + " from: " + from.fullPath)
start()
loadStart()
+
+ if (whiteList.indexOf(to.path) !== -1) {
+ next()
+ return
+ }
+
if (!getAccessToken()) {
- if (whiteList.indexOf(to.path) !== -1) {
- next()
- return
- } else {
- next(`/login?redirect=${to.fullPath}`) // 鍚﹀垯鍏ㄩ儴閲嶅畾鍚戝埌鐧诲綍椤�
- return
- }
+ next(`/login?redirect=${to.fullPath}`) // 鍚﹀垯鍏ㄩ儴閲嶅畾鍚戝埌鐧诲綍椤�
+ return
}
if (to.path === '/login') {
@@ -79,9 +84,14 @@
// 鑾峰彇鎵�鏈夊瓧鍏�
const dictStore = useDictStoreWithOut()
const userStore = useUserStoreWithOut()
+ const roomStore = useRoomStoreWithOut()
+ const checkTypeStore = useCheckTypeStoreWithOut()
const permissionStore = usePermissionStoreWithOut()
if (!dictStore.getIsSetDict) {
await dictStore.setDictMap()
+ }
+ if (!checkTypeStore.getIsSetCheckType) {
+ await checkTypeStore.setCheckTypeMap()
}
if (userStore.getIsSetUser ) {
@@ -89,7 +99,7 @@
// <<<銆愯瘖瀹ら�夋嫨銆�<<<
if ( to.path !== '/roomselect' &&
userStore.getRoles.includes("doctor") && !userStore.getRoles.includes("super_admin")
- && !userStore.getIsSetRoom ) {
+ && !roomStore.getIsSetRoom ) {
next({path: `/roomselect?redirect=${to.fullPath}`})
return
}
@@ -111,7 +121,7 @@
// <<<銆愯瘖瀹ら�夋嫨銆�<<<
if ( to.path !== '/roomselect' &&
userStore.getRoles.includes("doctor") && !userStore.getRoles.includes("super_admin")
- && !userStore.getIsSetRoom ) {
+ && !roomStore.getIsSetRoom ) {
next({path: `/roomselect?redirect=${to.fullPath}`})
return
}
--
Gitblit v1.9.3