From 889f4b49479a7d07773fbfc1fb1af09d8324b113 Mon Sep 17 00:00:00 2001 From: cgd_mac <349008059@qq.com> Date: Sat, 26 Feb 2022 15:38:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/GlobalHeader/ChangePassword.vue | 16 ++++++++++------ src/store/modules/user.js | 2 ++ src/views/mypractice/index.vue | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/GlobalHeader/ChangePassword.vue b/src/components/GlobalHeader/ChangePassword.vue index fd1879f..930ee5d 100644 --- a/src/components/GlobalHeader/ChangePassword.vue +++ b/src/components/GlobalHeader/ChangePassword.vue @@ -220,13 +220,17 @@ export default { if (!err) { this.btnLoading = true state.passwordLevelChecked = false - this.$store.dispatch('ChangePassword', values).then(res => { - this.btnLoading = false - this.$message.success('修改密码成功') - this.$store.dispatch('Logout').then(() => { - this.$router.push({ name: 'login' }) + this.$store + .dispatch('ChangePassword', values) + .then(res => { + this.$message.success('修改密码成功') + this.$store.dispatch('Logout').then(() => { + this.$router.push({ name: 'login' }) + }) + }) + .finally(() => { + this.btnLoading = false }) - }) } }) } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index bd2d3d5..07a26eb 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -93,6 +93,8 @@ const user = { password: data.password }).then(res => { resolve(res) + }).finally((error)=>{ + reject(error) }) } catch (error) { reject(error) diff --git a/src/views/mypractice/index.vue b/src/views/mypractice/index.vue index 95a2612..45f90ce 100644 --- a/src/views/mypractice/index.vue +++ b/src/views/mypractice/index.vue @@ -70,7 +70,7 @@ export default { courseType: '' // 课程分类 }, queryOptions: [ - { type: 'select-dic-tree', placeholder: '课程分类', key: 'courseType', options: [] } + { type: 'select-dic-tree', width: '200', placeholder: '课程分类', key: 'courseType', options: [] } ] } },