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