diff --git a/src/api/jyh/index.ts b/src/api/jyh/index.ts index 4ccc170..a2a0f04 100644 --- a/src/api/jyh/index.ts +++ b/src/api/jyh/index.ts @@ -359,3 +359,15 @@ export function uploadImage(file: File) { // } // }); } + +// 获取字典 +export function basicDict(data) { + return axios.request({ + url: '/gateway/basic/dict/children/list', + method: 'POST', + data: data, + headers: { + Authorization: 'Bearer ' + localStorage.getItem('access_token') + } + }); +} diff --git a/src/router/interceptor.ts b/src/router/interceptor.ts index a3f18e6..4eb708b 100644 --- a/src/router/interceptor.ts +++ b/src/router/interceptor.ts @@ -52,6 +52,8 @@ export const injectRouter = (router) => { // 判断命名空间类型 const globalStore = useGlobalInfoStore(); globalStore.setNamespaceType(-1); // 重置namespaceType,防止非组织路由请求组织信息 + debugger + globalStore.setLanguageList(); if (to.meta.pageType === 'userOrOrg') { const { namespace } = to.params; const params = { diff --git a/src/stores/Global/index.ts b/src/stores/Global/index.ts index ba63985..7769c54 100644 --- a/src/stores/Global/index.ts +++ b/src/stores/Global/index.ts @@ -4,6 +4,7 @@ import menu from '@/constant/menu'; import { type listType, type itemProps } from '@/components/NavTabs/types'; import { useRoute, useRouter } from 'vue-router'; import { getCustomMenuList } from '@/api/org/devIndex'; +import { basicDict } from '@/api/jyh'; export const useGlobalInfoStore = defineStore('globalInfo', () => { const route = useRoute(); @@ -30,6 +31,8 @@ export const useGlobalInfoStore = defineStore('globalInfo', () => { { value: 'National_Defense', name: '国防' }, ]); + const languageList = ref([]); + const menuInfo = computed(() => { // 当前菜单 return globalMenuInfo.value[menuType.value] || []; @@ -78,6 +81,13 @@ export const useGlobalInfoStore = defineStore('globalInfo', () => { } }; + // TODO:获取语言列表,待开发 + const setLanguageList = async() => { + const res = await basicDict({ + parentId: 184 + }); + }; + const updateHeaderSearch = (data: any) => { headerSearch.value = { ...data }; } @@ -137,6 +147,7 @@ export const useGlobalInfoStore = defineStore('globalInfo', () => { setNamespaceType, setGlobalTheme, updateHeaderSearch, - industryList + industryList, + setLanguageList }; });