|
@@ -147,7 +147,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
- switchStatus: '',
|
|
|
|
|
|
+ switchStatus: 'userManager',
|
|
avatarUrl: '',
|
|
avatarUrl: '',
|
|
show: false,
|
|
show: false,
|
|
headers: {
|
|
headers: {
|
|
@@ -169,16 +169,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.ruleForm2.username = this.userInfo.username
|
|
|
|
- this.ruleForm2.phone = this.userInfo.phone
|
|
|
|
- this.ruleForm2.avatar = this.userInfo.avatar
|
|
|
|
- this.switchStatus = 'userManager'
|
|
|
|
- handleImg(this.userInfo.avatar, 'avatar')
|
|
|
|
- //判断是否选择了租户ID
|
|
|
|
- const TENANT_ID = getStore({ name: 'tenantId' })
|
|
|
|
- if (TENANT_ID) {
|
|
|
|
- this.headers['TENANT-ID'] = TENANT_ID // 租户ID
|
|
|
|
- }
|
|
|
|
|
|
+ this.resetForm()
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState({
|
|
...mapState({
|
|
@@ -201,12 +192,7 @@ export default {
|
|
data: this.ruleForm2
|
|
data: this.ruleForm2
|
|
}).then(response => {
|
|
}).then(response => {
|
|
if (response.data.data) {
|
|
if (response.data.data) {
|
|
- this.$notify({
|
|
|
|
- title: '成功',
|
|
|
|
- message: '修改成功',
|
|
|
|
- type: 'success',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
|
|
+ this.$notify.success('修改成功')
|
|
// 修改密码之后强制重新登录
|
|
// 修改密码之后强制重新登录
|
|
if (this.switchStatus === 'passwordManager') {
|
|
if (this.switchStatus === 'passwordManager') {
|
|
this.$store.dispatch('LogOut').then(() => {
|
|
this.$store.dispatch('LogOut').then(() => {
|
|
@@ -214,20 +200,10 @@ export default {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- this.$notify({
|
|
|
|
- title: '失败',
|
|
|
|
- message: response.data.msg,
|
|
|
|
- type: 'error',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
|
|
+ this.$notify.error(response.data.msg)
|
|
}
|
|
}
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
- this.$notify({
|
|
|
|
- title: '失败',
|
|
|
|
- message: '修改失败',
|
|
|
|
- type: 'error',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
|
|
+ this.$notify.error('修改失败')
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
return false
|
|
return false
|
|
@@ -235,7 +211,18 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
resetForm(formName) {
|
|
resetForm(formName) {
|
|
- this.$refs[formName].resetFields()
|
|
|
|
|
|
+ this.ruleForm2.password = undefined
|
|
|
|
+ this.ruleForm2.newpassword1 = undefined
|
|
|
|
+ this.ruleForm2.newpassword2 = undefined
|
|
|
|
+ this.ruleForm2.username = this.userInfo.username
|
|
|
|
+ this.ruleForm2.phone = this.userInfo.phone
|
|
|
|
+ this.ruleForm2.avatar = this.userInfo.avatar
|
|
|
|
+ handleImg(this.userInfo.avatar, 'avatar')
|
|
|
|
+ //判断是否选择了租户ID
|
|
|
|
+ const TENANT_ID = getStore({ name: 'tenantId' })
|
|
|
|
+ if (TENANT_ID) {
|
|
|
|
+ this.headers['TENANT-ID'] = TENANT_ID // 租户ID
|
|
|
|
+ }
|
|
},
|
|
},
|
|
handleClick(thirdpart) {
|
|
handleClick(thirdpart) {
|
|
let appid, client_id, redirect_uri, url
|
|
let appid, client_id, redirect_uri, url
|