From 6d576159e36588170d683059fa225a5ccfda8465 Mon Sep 17 00:00:00 2001 From: linhaojun Date: Fri, 16 Sep 2022 17:03:09 +0800 Subject: [PATCH] =?UTF-8?q?:rocket:=20=E5=89=8D=E5=8F=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aurora-vue/aurora-blog/src/api/api.ts | 3 ++ .../src/components/Header/src/Controls.vue | 34 +++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/aurora-vue/aurora-blog/src/api/api.ts b/aurora-vue/aurora-blog/src/api/api.ts index 032a921..e67a388 100644 --- a/aurora-vue/aurora-blog/src/api/api.ts +++ b/aurora-vue/aurora-blog/src/api/api.ts @@ -131,5 +131,8 @@ export default { }, getRepliesByCommentId: (commentId: any) => { return axios.get(`/api/comments/${commentId}/replies`) + }, + updatePassword:(params:any)=>{ + return axios.put('/api/users/password',params) } } diff --git a/aurora-vue/aurora-blog/src/components/Header/src/Controls.vue b/aurora-vue/aurora-blog/src/components/Header/src/Controls.vue index 441ab17..f61d111 100644 --- a/aurora-vue/aurora-blog/src/components/Header/src/Controls.vue +++ b/aurora-vue/aurora-blog/src/components/Header/src/Controls.vue @@ -44,7 +44,7 @@ - + 登录 @@ -64,14 +64,14 @@ - + - + 注册 @@ -85,17 +85,17 @@ - + - + - 确定 + 确定 返回登录 @@ -281,6 +281,25 @@ export default defineComponent({ ) } } + const updatePassword = () => { + api.updatePassword(loginInfo).then(({ data }) => { + if (data.flag) { + proxy.$notify({ + title: 'Success', + message: '修改成功', + type: 'success' + }) + reactiveDate.forgetPasswordDialogVisible = false + reactiveDate.loginDialogVisible = true + } else { + proxy.$notify({ + title: 'Error', + message: data.message, + type: 'error' + }) + } + }) + } return { handleOpenModel, @@ -298,6 +317,7 @@ export default defineComponent({ returnLoginDialog, sendCode, register, + updatePassword, openForgetPasswordDialog, multiLanguage: computed(() => { let websiteConfig: any = appStore.websiteConfig