|
@@ -4,6 +4,7 @@ import { usePermissionStore } from "@/store/modules/permission";
|
|
|
import { useDictionaryStore } from "@/store/modules/dictionary";
|
|
|
|
|
|
import NProgress from "@/utils/nprogress";
|
|
|
+import { getUserDicts } from "@/api/auth";
|
|
|
|
|
|
export function setupPermission() {
|
|
|
// 白名单路由
|
|
@@ -19,7 +20,12 @@ export function setupPermission() {
|
|
|
NProgress.done();
|
|
|
} else {
|
|
|
const dictStore = useDictionaryStore();
|
|
|
- dictStore.checkDicts();
|
|
|
+ if (JSON.stringify(dictStore.dicts.value) === "{}") {
|
|
|
+ const res = await getUserDicts(dictStore.types);
|
|
|
+ if (res.data) {
|
|
|
+ dictStore.dicts.value = res?.data ?? [];
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
// const hasRoles =
|