@clownlee/cores 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -8
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -943,17 +943,18 @@ function usePermissionCheck(permission, logic = "OR", matchMode = "exact", permi
|
|
|
943
943
|
try {
|
|
944
944
|
const store = permissionStore;
|
|
945
945
|
let permissions = [];
|
|
946
|
-
|
|
947
|
-
|
|
946
|
+
const storeValue = (store == null ? void 0 : store.value) !== void 0 ? store.value : store;
|
|
947
|
+
if (storeValue[permissionKey]) {
|
|
948
|
+
const value = storeValue[permissionKey];
|
|
948
949
|
permissions = Array.isArray(value == null ? void 0 : value.value) ? value.value : Array.isArray(value) ? value : [];
|
|
949
|
-
} else if (
|
|
950
|
-
const value =
|
|
950
|
+
} else if (storeValue.$state && storeValue.$state[permissionKey]) {
|
|
951
|
+
const value = storeValue.$state[permissionKey];
|
|
951
952
|
permissions = Array.isArray(value) ? value : [];
|
|
952
|
-
} else if (
|
|
953
|
-
const value =
|
|
953
|
+
} else if (storeValue.state && storeValue.state[permissionKey]) {
|
|
954
|
+
const value = storeValue.state[permissionKey];
|
|
954
955
|
permissions = Array.isArray(value) ? value : [];
|
|
955
|
-
} else if (
|
|
956
|
-
const value =
|
|
956
|
+
} else if (storeValue.permissions) {
|
|
957
|
+
const value = storeValue.permissions;
|
|
957
958
|
permissions = Array.isArray(value == null ? void 0 : value.value) ? value.value : Array.isArray(value) ? value : [];
|
|
958
959
|
}
|
|
959
960
|
permissions = flattenPermissions(permissions);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clownlee/cores",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "公共核心库,提供统一的 HTTP 请求能力和自动 token 刷新功能",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts"
|
|
13
|
-
}
|
|
13
|
+
},
|
|
14
|
+
"./iconfont.css": "./dist/assets/iconfont.css"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
17
|
"dist"
|