Merge pull request #4546 from dataease/pr@dev_memory_component

Pr@dev memory component
This commit is contained in:
dataeaseShu 2023-02-15 17:30:44 +08:00 committed by GitHub
commit 7bdcf0dea8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -7,6 +7,7 @@
component-name="ThemeSetting"
/>
<el-dialog
v-if="$route.path !== '/login'"
:visible.sync="showPasswordModifiedDialog"
append-to-body
:title="$t('user.change_password')"
@ -35,6 +36,12 @@ export default {
showPasswordModifiedDialog: false
}
},
mounted() {
const passwordModified = JSON.parse(localStorage.getItem('passwordModified'))
if (typeof passwordModified === 'boolean') {
this.$store.commit('user/SET_PASSWORD_MODIFIED', passwordModified)
}
},
watch: {
passwordModified: {
handler(val) {

View File

@ -83,9 +83,12 @@ const actions = {
commit('SET_TOKEN', data.token)
commit('SET_LOGIN_MSG', null)
setToken(data.token)
if(data.hasOwnProperty('passwordModified')){
commit('SET_PASSWORD_MODIFIED', data.passwordModified)
let passwordModified = true
if (data.hasOwnProperty('passwordModified')) {
passwordModified = data.passwordModified
}
commit('SET_PASSWORD_MODIFIED', passwordModified)
localStorage.setItem('passwordModified', passwordModified)
resolve()
}).catch(error => {
reject(error)