Commit 447d37d1 authored by 华国豪's avatar 华国豪 🙄

语言切换刷新还原成中文,新增修改语言本地缓存

parent 2fc22c9b
...@@ -1313,6 +1313,14 @@ export default { ...@@ -1313,6 +1313,14 @@ export default {
created() { created() {
//页面刚进入时开启长连接 //页面刚进入时开启长连接
// this.initWebSocket() // this.initWebSocket()
let language = localStorage.language
if (!language) {
this.language = 'zh-CN';
this.$i18n.locale = 'zh-CN';
} else {
this.language = language
this.$i18n.locale = language;
}
//IM_body //IM_body
let allWindowWidth = window.innerWidth; let allWindowWidth = window.innerWidth;
this.allWindowWidth = allWindowWidth - 50 - 220 - 60; this.allWindowWidth = allWindowWidth - 50 - 220 - 60;
...@@ -1328,6 +1336,7 @@ export default { ...@@ -1328,6 +1336,7 @@ export default {
ChangeLan(str){ ChangeLan(str){
this.language=str; this.language=str;
this.$i18n.locale = str; this.$i18n.locale = str;
localStorage.language = str;
}, },
settingSys: function () { settingSys: function () {
this.MsgBus.$emit('settingOpen') this.MsgBus.$emit('settingOpen')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment