From 2b7c1ad1a7b75e2bfc8d07f2bd75e6979e1a36c0 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Fri, 5 Aug 2022 10:20:20 +0800 Subject: [PATCH] chore: config --- docs/.vuepress/config/navbar.js | 4 ++-- docs/.vuepress/public/js/redirect.js | 32 ++++++---------------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/docs/.vuepress/config/navbar.js b/docs/.vuepress/config/navbar.js index 4c30d96c9..ac0bb166b 100644 --- a/docs/.vuepress/config/navbar.js +++ b/docs/.vuepress/config/navbar.js @@ -172,9 +172,9 @@ export const navbarLanguage = { { text: 'English', link: 'https://en.uniapp.dcloud.io/', - click() { + /* click() { localStorage.setItem(window.__UNI_DOCS_ZH_KEY__ || 'unidocs-zh-language', 'en') - } + } */ } ] } \ No newline at end of file diff --git a/docs/.vuepress/public/js/redirect.js b/docs/.vuepress/public/js/redirect.js index 736dd357d..6aa4e6eab 100644 --- a/docs/.vuepress/public/js/redirect.js +++ b/docs/.vuepress/public/js/redirect.js @@ -6,32 +6,12 @@ var website_EN_host = 'en.uniapp.dcloud.io' var website_ZH = 'https://' + website_ZH_host; var website_EN = 'https://' + website_EN_host; -window.__UNI_DOCS_ZH_KEY__ = 'unidocs-zh-language' +// window.__UNI_DOCS_ZH_KEY__ = 'unidocs-zh-language' if (host === 'uniapp.dcloud.io') { - var localStorageLanguage = localStorage.getItem(window.__UNI_DOCS_ZH_KEY__) - - if (localStorageLanguage) { - switch (localStorageLanguage) { - case LOCAL_ZH: - if (host !== website_ZH_host) { - window.location.href = website_ZH + pathname; - } - break; - case LOCAL_EN: - if (host !== website_EN_host) { - window.location.href = website_EN + pathname; - } - break; - - default: - break; - } - } else { - var website_finally = - navigator.language.indexOf('zh') !== -1 - ? website_ZH - : website_EN; - window.location.href = website_finally + pathname; - } + var website_finally = + navigator.language.indexOf('zh') !== -1 + ? website_ZH + : website_EN; + window.location.href = website_finally + pathname; } \ No newline at end of file -- GitLab