NEZ-2928 fix:开启多个页面,存在不同语言的情况下,在界面开启Rules的定时计划提示信息语言不一致

This commit is contained in:
zhangyu
2023-06-27 14:27:53 +08:00
parent ea62255cd1
commit 06f849fb66
3 changed files with 6 additions and 0 deletions

View File

@@ -318,6 +318,7 @@ export default {
localStorage.setItem('nz-username', this.loginData.username)
localStorage.setItem('nz-prometheus-federation-enabled', res.data.prometheusFederationEnabled)
localStorage.setItem('nz-language', this.lang)
this.$store.commit('setLanguage', this.lang)
this.loginSuccess(res)
}
} else {
@@ -339,6 +340,7 @@ export default {
localStorage.setItem('nz-username', this.loginData.username)
localStorage.setItem('nz-prometheus-federation-enabled', res.data.prometheusFederationEnabled)
localStorage.setItem('nz-language', this.lang)
this.$store.commit('setLanguage', this.lang)
res.data.user = {
...this.userInfo
}

View File

@@ -138,6 +138,7 @@ export default {
this.esc(true)
if (this.editProfile.lang !== localStorage.getItem('nz-language')) {
localStorage.setItem('nz-language', this.editProfile.lang)
this.$store.commit('setLanguage', this.editProfile.lang)
this.$i18n.locale = this.editProfile.lang
this.$emit('clickProfile', true)
} else {

View File

@@ -221,6 +221,9 @@ export default {
if (this.username != localStorage.getItem('nz-username')) {
this.$router.go(0)
}
if (this.$store.getters.getLanguage && (this.$store.getters.getLanguage !== localStorage.getItem('nz-language'))) {
localStorage.setItem('nz-language', this.$store.getters.getLanguage)
}
}
},
mounted () {