diff --git a/src/api/regional/dict/regdict.ts b/src/api/regional/dict/regdict.ts
index 7b16e2f..33cbd26 100644
--- a/src/api/regional/dict/regdict.ts
+++ b/src/api/regional/dict/regdict.ts
@@ -50,3 +50,10 @@ export function delregdict(regdictId: number) {
method: 'delete'
})
}
+// 清空缓存
+export function clearCache() {
+ return request({
+ url: '/transitdict/regdict/clearCache',
+ method: 'get'
+ })
+}
diff --git a/src/components/SelectTable/index.vue b/src/components/SelectTable/index.vue
index 18b9713..5519b2a 100644
--- a/src/components/SelectTable/index.vue
+++ b/src/components/SelectTable/index.vue
@@ -19,7 +19,7 @@
+ :disabled="props.disabled" v-bind="$attrs">
@@ -70,6 +70,7 @@ const props = withDefaults(defineProps
(), {
optionselect: false,
clearable: true,
objKey: 'value',
+ disabled: false,
keyValue: false,
fields: () => [
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
diff --git a/src/utils/auth.ts b/src/utils/auth.ts
index 8c2e07f..a4c77fc 100644
--- a/src/utils/auth.ts
+++ b/src/utils/auth.ts
@@ -1,6 +1,6 @@
import Cookies from 'js-cookie'
-const TokenKey = 'Admin-Token'
+const TokenKey = 'Admin_czlis-Token'
export function getToken(): string | undefined {
return Cookies.get(TokenKey)
diff --git a/src/utils/permission.ts b/src/utils/permission.ts
index df75cf3..cd6ea95 100644
--- a/src/utils/permission.ts
+++ b/src/utils/permission.ts
@@ -31,21 +31,21 @@ export function checkPermi(value: string[]): boolean {
* @returns {Boolean}
*/
export function checkRole(value: string[]): boolean {
- if (value && value instanceof Array && value.length > 0) {
- const roles = useUserStore().roles
- const permissionRoles = value
- const super_admin = "admin"
-
- const hasRole = roles.some((role: string) => {
- return super_admin === role || permissionRoles.includes(role)
- })
-
- if (!hasRole) {
- return false
- }
- return true
- } else {
+ if (!value || !(value instanceof Array) || value.length === 0) {
console.error(`need roles! Like checkRole="['admin','editor']"`)
return false
}
-}
+
+ const userStore = useUserStore()
+ const roles = userStore.roles
+ const permissionRoles = value
+
+ // 取出 roleKey 进行判断
+ const hasRole = roles.some((role: any) => {
+ const roleKey = role.roleKey || ''
+ // 是超级管理员 admin 或者 包含指定角色
+ return roleKey === 'admin' || permissionRoles.includes(roleKey)
+ })
+
+ return hasRole
+}
\ No newline at end of file
diff --git a/src/views/liswork/dict/index.vue b/src/views/liswork/dict/index.vue
index 5a7cd8d..493b9cc 100644
--- a/src/views/liswork/dict/index.vue
+++ b/src/views/liswork/dict/index.vue
@@ -1,7 +1,7 @@