From 375fc37af02289117bfd4a92100ad67b2f7d2ae2 Mon Sep 17 00:00:00 2001 From: ray <1490493387@qq.com> Date: Mon, 19 Aug 2024 00:30:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=AD=E5=BF=83Alpha=E5=BC=80=E5=8F=91=E9=98=B6=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user.ts | 16 ++ src/views/profile/index.vue | 320 ++++++++++++++++++++++++------------ 2 files changed, 235 insertions(+), 101 deletions(-) diff --git a/src/api/user.ts b/src/api/user.ts index ab088500..1e96d5e8 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -162,6 +162,20 @@ class UserAPI { data: data, }); } + + /** + * 发送手机/邮箱验证码 + * + * @param contact 联系方式 手机号/邮箱 + * @param contactType 联系方式类型 MOBILE:手机;EMAIL:邮箱 + */ + static sendVerificationCode(contact: string, contactType: string) { + return request({ + url: `${USER_BASE_URL}/send-verification-code`, + method: "get", + params: { contact: contact, contactType: contactType }, + }); + } } export default UserAPI; @@ -317,6 +331,8 @@ export interface PasswordChangeForm { oldPassword?: string; /** 新密码 */ newPassword?: string; + /** 确认新密码 */ + confirmPassword?: string; } /** 手机绑定表单 */ diff --git a/src/views/profile/index.vue b/src/views/profile/index.vue index 314ea562..ccf03c2b 100644 --- a/src/views/profile/index.vue +++ b/src/views/profile/index.vue @@ -2,34 +2,35 @@
- +
- -
- -
- - - -
-
- {{ userProfile.nickname }} - - - -
+ + +
+ + + +
+
+ {{ userProfile.nickname }} + + +
@@ -177,12 +178,29 @@ - + + + + + + + + + + + + - + + - - - - - {{ - mobileCountdown > 0 - ? `${mobileCountdown}s后重新发送` - : "发送验证码" - }} - + - + + + + + - - - - - {{ - emailCountdown > 0 ? `${emailCountdown}s后重新发送` : "发送验证码" - }} - + - + + +