This commit is contained in:
clay
2022-01-22 20:45:07 +08:00
parent 72fbaed559
commit 6b2d1034c2
20 changed files with 181 additions and 149 deletions

View File

@@ -39,3 +39,30 @@ export function getParentNode(id) {
}
}
export function setAppLanguage(that){
let lang = sessionStorage.getItem("lang");
if (lang != null){
that.$i18n.locale = lang
return
}
var language = window.navigator.userLanguage || window.navigator.language;
if (language == 'zh-CN'){
lang = 'cn'
}else {
lang = 'en'
}
that.$i18n.locale = lang
sessionStorage.setItem("lang",lang)
}
export function setLanguage(that){
let lang = that.$route.query && that.$route.query.lang
if (lang != undefined){
that.$i18n.locale = lang
sessionStorage.setItem("lang",lang)
}
}