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

This commit is contained in:
CaptainB 2021-12-16 18:05:40 +08:00 committed by 刘瑞斌
parent 3b53f6a697
commit 22094ed429

View File

@ -35,7 +35,7 @@ const loadedLanguages = ['en_US', 'zh_CN', 'zh_TW'];
function setI18nLanguage(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);
return lang;
}