CN-1307 fix: 经讨论,当修改的用户为当前登录用户,且修改的语言与当前语言不一致时,切换当前语言为修改的语言
This commit is contained in:
@@ -251,13 +251,20 @@ export default {
|
|||||||
this.blockOperation.save = false
|
this.blockOperation.save = false
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||||
|
if (this.editObject.lang && this.editObject.id == localStorage.getItem(storageKey.userId)) {
|
||||||
|
const currentLang = localStorage.getItem(storageKey.language)
|
||||||
|
if (currentLang !== this.editObject.lang) {
|
||||||
|
localStorage.setItem(storageKey.language, this.editObject.lang)
|
||||||
|
window.location.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
this.esc(true)
|
this.esc(true)
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg || res.data.message)
|
this.$message.error(res.data.msg || res.data.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.blockOperation.save = false
|
this.blockOperation.save = false
|
||||||
let errMsg = err.response ? err.response : (err.message ? err.message : err.toString())
|
const errMsg = err.response ? err.response : (err.message ? err.message : err.toString())
|
||||||
this.$message.error(_.get(errMsg, 'data.message', []))
|
this.$message.error(_.get(errMsg, 'data.message', []))
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user