From 12418c9703f2b3dec8bdba2bf2aff09e009d1a77 Mon Sep 17 00:00:00 2001 From: wxs <211789910@qq.com> Date: Thu, 5 Mar 2026 17:50:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=9B=BD=E9=99=85=E5=8C=96=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E5=AF=B9=E6=8E=A5=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/Skyeye-sys-ui/src/api/http.js | 2 ++ frontend/Skyeye-sys-ui/src/lang/index.js | 8 ++++---- .../src/layout/components/header-nav/index.vue | 14 ++++++++++---- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/frontend/Skyeye-sys-ui/src/api/http.js b/frontend/Skyeye-sys-ui/src/api/http.js index 6409dd6..b6f002e 100644 --- a/frontend/Skyeye-sys-ui/src/api/http.js +++ b/frontend/Skyeye-sys-ui/src/api/http.js @@ -17,6 +17,8 @@ instance.interceptors.request.use( config.headers = config.headers || {} let token = getToken() if (token) Object.assign(config.headers, { 'X-Access-Token': token }) + const language = localStorage.getItem('locale') + Object.assign(config.headers, { 'content-language': language }) config.cancelToken = new axios.CancelToken(cancel => { window.__axiosCancelTokenArr.push({ cancel }) }) diff --git a/frontend/Skyeye-sys-ui/src/lang/index.js b/frontend/Skyeye-sys-ui/src/lang/index.js index e66305e..99aa884 100644 --- a/frontend/Skyeye-sys-ui/src/lang/index.js +++ b/frontend/Skyeye-sys-ui/src/lang/index.js @@ -6,15 +6,15 @@ Vue.use(VueI18n) // load locale messages const messages = { - zh, - en, + 'zh_CN': zh, + 'en_US': en, } -const locale = localStorage.getItem('locale') || 'zh' +const locale = localStorage.getItem('locale') || 'zh_CN' const i18n = new VueI18n({ locale, - fallbackLocale: 'zh', + fallbackLocale: 'zh_CN', messages, }) diff --git a/frontend/Skyeye-sys-ui/src/layout/components/header-nav/index.vue b/frontend/Skyeye-sys-ui/src/layout/components/header-nav/index.vue index 05ebe4f..2b0284a 100644 --- a/frontend/Skyeye-sys-ui/src/layout/components/header-nav/index.vue +++ b/frontend/Skyeye-sys-ui/src/layout/components/header-nav/index.vue @@ -26,10 +26,13 @@