fix: 修复国际化后台失效的问题

This commit is contained in:
CaptainB 2021-12-16 18:05:40 +08:00 committed by 刘瑞斌
parent 3b53f6a697
commit 22094ed429
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ const loadedLanguages = ['en_US', 'zh_CN', 'zh_TW'];
function setI18nLanguage(lang) { function setI18nLanguage(lang) {
i18n.locale = lang; i18n.locale = lang;
axios.defaults.headers.common['Accept-Language'] = lang; axios.defaults.headers.common['Accept-Language'] = lang.replace("_", "-");
document.querySelector('html').setAttribute('lang', lang); document.querySelector('html').setAttribute('lang', lang);
return lang; return lang;
} }