From 60352460cb7b22c6f1e9fbcf7412d05eaf02e0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E6=B0=91=E5=BA=B7?= Date: Fri, 13 Jun 2025 10:29:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BF=A1=E4=BB=A3=E7=A0=81=E5=BA=93-?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E5=88=97=E8=A1=A8=E5=BE=85=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jyh/index.ts | 12 ++++++++++++ src/router/interceptor.ts | 2 ++ src/stores/Global/index.ts | 13 ++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) 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 }; });