|
@@ -183,20 +183,27 @@ export default {
|
|
|
* @returns {Promise<void>}
|
|
|
*/
|
|
|
async logout() {
|
|
|
- await this.$store.dispatch('user/Logout')
|
|
|
- this.$router.push(`/login?redirect=${this.$route.fullPath}`)
|
|
|
+ const res = await this.$store.dispatch('user/Logout')
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '退出成功'
|
|
|
+ })
|
|
|
+ this.$router.push(`/login?redirect=${this.$route.fullPath}`)
|
|
|
+ }
|
|
|
},
|
|
|
/** 修改密码 */
|
|
|
submit() {
|
|
|
this.$refs.psdForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
const data = this.$store.dispatch('user/UpdatePassword', this.form)
|
|
|
- data.then(res => {
|
|
|
+ data.then(async(res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: '修改成功'
|
|
|
})
|
|
|
+ await this.logout()
|
|
|
this.dialogVisible = false
|
|
|
}
|
|
|
})
|