|
@@ -1,4 +1,5 @@
|
|
|
import { cloneDeep } from 'lodash';
|
|
|
+import { useUserStore } from '@/store';
|
|
|
|
|
|
export const extractFileName = (str) => {
|
|
|
if (/filename=([^;\s]*)/gi.test(str)) {
|
|
@@ -376,3 +377,13 @@ export const dictToOptionList = (data) => {
|
|
|
return { value: kstr, label: data[k] };
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+/**
|
|
|
+ * 判断用户的权限集里有没有
|
|
|
+ * @param {*} key
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+export const hasPerm = (key) => {
|
|
|
+ const userStore = useUserStore();
|
|
|
+ return userStore.finePermissionIds.includes(key);
|
|
|
+};
|