forked from github/dataease
feat: 修改密码前端持久化
This commit is contained in:
parent
496feb435a
commit
c37f86f742
@ -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) {
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user