perf: 优化国际化逻辑

This commit is contained in:
陈劲松
2020-03-13 11:06:54 +08:00
parent a80325589e
commit 0cad2d7f35
2 changed files with 5 additions and 6 deletions

View File

@@ -380,8 +380,7 @@
})
},
changeLocal(lang) {
if (lang != localStorage.getItem("nz-language-" + this.username)) {
localStorage.setItem("nz-language-" + this.username, lang);
if (lang != localStorage.getItem("nz-language")) {
localStorage.setItem("nz-language", lang);
this.$i18n.locale = lang;
window.location.reload();
@@ -445,7 +444,7 @@
})
},
refreshLang() {
this.language = localStorage.getItem("nz-language-" + this.username);
this.language = localStorage.getItem("nz-language");
this.$i18n.locale = this.language;
},
showPwdDialog:function(){