From 70fe6f6a46bf6d6184220d50b1653ea9628f4bae Mon Sep 17 00:00:00 2001 From: lannoy0523 <46735290+lannoy0523@users.noreply.github.com> Date: Wed, 11 Sep 2024 09:56:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20repository=E5=89=8D=E7=AB=AF=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20#2555?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: repository前端优化 #2555 * feat: repository前端优化 #2555 --- .../src/components/Header/index.vue | 14 +++++++------- src/frontend/locale/index.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/frontend/devops-repository/src/components/Header/index.vue b/src/frontend/devops-repository/src/components/Header/index.vue index e33c46d860..559451f562 100644 --- a/src/frontend/devops-repository/src/components/Header/index.vue +++ b/src/frontend/devops-repository/src/components/Header/index.vue @@ -89,15 +89,15 @@ icons: { type: Array, default: () => [ - { - icon: 'english', - name: 'English', - id: 'en' - }, { icon: 'chinese', name: '中文', id: 'zh-cn' + }, + { + icon: 'english', + name: 'English', + id: 'en' } ] } @@ -144,11 +144,11 @@ const BK_CI_DOMAIN = location.host.split('.').slice(1).join('.') if (id !== 'zh-cn') { cookies.remove('blueking_language', { domain: BK_CI_DOMAIN, path: '/' }) - cookies.set('blueking_language', 'en', { domain: BK_CI_DOMAIN, path: '/' }) + cookies.set('blueking_language', 'en', { domain: BK_CI_DOMAIN, path: '/', expires: 366 }) location.reload() } else { cookies.remove('blueking_language', { domain: BK_CI_DOMAIN, path: '/' }) - cookies.set('blueking_language', 'zh-cn', { domain: BK_CI_DOMAIN, path: '/' }) + cookies.set('blueking_language', 'zh-cn', { domain: BK_CI_DOMAIN, path: '/', expires: 366 }) location.reload() } }, diff --git a/src/frontend/locale/index.js b/src/frontend/locale/index.js index 8d0a756975..575bdd6034 100644 --- a/src/frontend/locale/index.js +++ b/src/frontend/locale/index.js @@ -40,7 +40,7 @@ function getLsLocale () { function setLsLocale (locale) { if (typeof cookies.set === 'function') { cookies.remove(LS_KEY, { domain: BK_CI_DOMAIN, path: '/' }) - cookies.set(LS_KEY, localeAliasMap[locale], { domain: BK_CI_DOMAIN, path: '/' }) + cookies.set(LS_KEY, localeAliasMap[locale], { domain: BK_CI_DOMAIN, path: '/', expires: 366 }) } }