|
@@ -126,9 +126,6 @@
|
|
|
import { mapGetters } from "vuex";
|
|
|
import axios from "axios";
|
|
|
import Vue from "vue";
|
|
|
-import enLocale from "element-ui/lib/locale/lang/en";
|
|
|
-import zhLocale from "element-ui/lib/locale/lang/zh-CN";
|
|
|
-import ruLocale from "element-ui/lib/locale/lang/ru-RU";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -162,11 +159,6 @@ export default {
|
|
|
sessionStorage.removeItem(key);
|
|
|
});
|
|
|
sessionStorage.setItem("active_account", JSON.stringify(item));
|
|
|
- await this.basicData.query_userauth(()=>{
|
|
|
- setTimeout(() => {
|
|
|
- this.$router.go(0);
|
|
|
- },1000);
|
|
|
- })
|
|
|
this.siteInfos();
|
|
|
this.accountInfo = JSON.parse(sessionStorage.getItem("active_account"));
|
|
|
this.accountList = JSON.parse(
|
|
@@ -174,7 +166,6 @@ export default {
|
|
|
).filter((e) => {
|
|
|
return e.siteid !== this.accountInfo.siteid;
|
|
|
});
|
|
|
-
|
|
|
},
|
|
|
async getWeather() {
|
|
|
const res = await axios.get(this.url);
|
|
@@ -188,7 +179,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
loginOut() {
|
|
|
- let lang = sessionStorage.getItem("lang");
|
|
|
+ let lang = localStorage.getItem("lang");
|
|
|
this.$confirm(this.$t("是否要退出当前账号") + "?", this.$t("提示"), {
|
|
|
confirmButtonText: this.$t("确定"),
|
|
|
cancelButtonText: this.$t("取消"),
|
|
@@ -196,7 +187,7 @@ export default {
|
|
|
})
|
|
|
.then(() => {
|
|
|
sessionStorage.clear();
|
|
|
- sessionStorage.setItem("lang", lang);
|
|
|
+ localStorage.setItem("lang", lang);
|
|
|
this.$router.push("/");
|
|
|
location.reload();
|
|
|
})
|
|
@@ -211,15 +202,8 @@ export default {
|
|
|
changeAccount() {
|
|
|
this.$router.push("/accounts");
|
|
|
},
|
|
|
- handleCommand(command) {
|
|
|
- sessionStorage.setItem("lang", command);
|
|
|
- this.basicData.query_userauth().then(() => {
|
|
|
- this.$router.go(0);
|
|
|
- });
|
|
|
- },
|
|
|
//跳转到应用,并设设置激活模块
|
|
|
handelMenuAppClick(app, type) {
|
|
|
-
|
|
|
let system = JSON.parse(sessionStorage.getItem("module_info"));
|
|
|
|
|
|
let mod = system
|
|
@@ -252,24 +236,32 @@ export default {
|
|
|
|
|
|
this.$router.push({ path: clickApp[0].path });
|
|
|
},
|
|
|
+
|
|
|
async languagelist() {
|
|
|
const res = await this.$api.requested({
|
|
|
id: 10026401,
|
|
|
});
|
|
|
-
|
|
|
this.langusge = res.data;
|
|
|
- this.nowType = sessionStorage.getItem("lang")
|
|
|
- ? sessionStorage.getItem("lang")
|
|
|
+ this.nowType = localStorage.getItem("lang")
|
|
|
+ ? localStorage.getItem("lang")
|
|
|
: "ZH";
|
|
|
+ this.languagename =
|
|
|
+ this.langusge.find((v) => v.languagecode == this.nowType)
|
|
|
+ .languagename || "简体中文";
|
|
|
},
|
|
|
async i18nChangeLanguage(type) {
|
|
|
- sessionStorage.setItem("lang", type);
|
|
|
- await this.basicData.query_userauth();
|
|
|
- this.$router.go(0);
|
|
|
+ this.nowType = type;
|
|
|
+ this.languagename =
|
|
|
+ this.langusge.find((v) => v.languagecode == this.nowType)
|
|
|
+ .languagename || "简体中文";
|
|
|
+ localStorage.setItem("lang", type);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$i18n.locale = type;
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
async qusetLanguage() {
|
|
|
- this.nowType = sessionStorage.getItem('lang').toUpperCase()
|
|
|
+ this.nowType = sessionStorage.getItem("lang").toUpperCase();
|
|
|
const res = await this.$api.requested({
|
|
|
id: 2024062809072801,
|
|
|
content: {
|
|
@@ -294,7 +286,7 @@ export default {
|
|
|
this.languagename = this.langusge.filter(
|
|
|
(e) => e.languagecode == this.nowType
|
|
|
)[0].languagename;
|
|
|
- console.log(this.languagename,'语言名称')
|
|
|
+ console.log(this.languagename, "语言名称");
|
|
|
},
|
|
|
},
|
|
|
|