fix(系统设置): i18n

This commit is contained in:
shiziyuan9527 2022-10-17 16:51:04 +08:00 committed by lyh
parent 452ae34948
commit abbae8bd05
1 changed files with 6 additions and 0 deletions

View File

@ -57,6 +57,12 @@ instance.interceptors.request.use(
} }
) )
let language = localStorage.getItem('language');
if (!language) {
language = navigator.language || navigator.browserLanguage;
}
instance.defaults.headers.common['Accept-Language'] = language;
function clearLocalStorage() { function clearLocalStorage() {
localStorage.removeItem(TokenKey); localStorage.removeItem(TokenKey);
sessionStorage.removeItem(WORKSPACE_ID); sessionStorage.removeItem(WORKSPACE_ID);