From 01b8a6840c7b905a0fefa1f0e584143f8465fc57 Mon Sep 17 00:00:00 2001 From: ray <1490493387@qq.com> Date: Mon, 13 Jan 2025 18:25:48 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20:hammer:=20=E9=80=82=E9=85=8D=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E5=8F=91=E9=80=81=E9=AA=8C=E8=AF=81=E7=A0=81=E5=92=8C?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/user.ts | 36 +++++++------ src/views/login/index.vue | 20 +++---- src/views/profile/index.vue | 103 +++++++++++++++++++----------------- 3 files changed, 83 insertions(+), 76 deletions(-) diff --git a/src/api/system/user.ts b/src/api/system/user.ts index 998c94a4..7045f6c3 100644 --- a/src/api/system/user.ts +++ b/src/api/system/user.ts @@ -163,22 +163,17 @@ const UserAPI = { }); }, - /** - * 发送手机/邮箱验证码 - * - * @param contact 联系方式 手机号/邮箱 - * @param contactType 联系方式类型 MOBILE:手机;EMAIL:邮箱 - */ - sendVerificationCode(contact: string, contactType: string) { + /** 发送短信验证码(绑定或更换手机号)*/ + sendMobileCode(mobile: string) { return request({ - url: `${USER_BASE_URL}/send-verification-code`, - method: "get", - params: { contact: contact, contactType: contactType }, + url: `${USER_BASE_URL}/mobile/code`, + method: "post", + params: { mobile: mobile }, }); }, - /** 绑定个人中心用户手机 */ - bindMobile(data: MobileBindingForm) { + /** 绑定或更换手机号 */ + bindOrChangeMobile(data: MobileUpdateForm) { return request({ url: `${USER_BASE_URL}/mobile`, method: "put", @@ -186,8 +181,17 @@ const UserAPI = { }); }, - /** 绑定个人中心用户邮箱 */ - bindEmail(data: EmailBindingForm) { + /** 发送邮箱验证码(绑定或更换邮箱)*/ + sendEmailCode(email: string) { + return request({ + url: `${USER_BASE_URL}/email/code`, + method: "post", + params: { email: email }, + }); + }, + + /** 绑定或更换邮箱 */ + bindOrChangeEmail(data: EmailUpdateForm) { return request({ url: `${USER_BASE_URL}/email`, method: "put", @@ -364,7 +368,7 @@ export interface PasswordChangeForm { } /** 修改手机表单 */ -export interface MobileBindingForm { +export interface MobileUpdateForm { /** 手机号 */ mobile?: string; /** 验证码 */ @@ -372,7 +376,7 @@ export interface MobileBindingForm { } /** 修改邮箱表单 */ -export interface EmailBindingForm { +export interface EmailUpdateForm { /** 邮箱 */ email?: string; /** 验证码 */ diff --git a/src/views/login/index.vue b/src/views/login/index.vue index b40c5e6e..84e7784a 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -16,7 +16,7 @@