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 }) } }