From e5ec780a44837209aab825dd68962f189e1bea14 Mon Sep 17 00:00:00 2001
From: "Ray.Hao" <1490493387@qq.com>
Date: Wed, 14 Jan 2026 11:03:43 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=A7=A3=E7=BB=91?=
=?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E5=92=8C=E9=82=AE=E7=AE=B1=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=EF=BC=8C=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E8=B5=84?=
=?UTF-8?q?=E6=96=99=E9=A1=B5=E9=9D=A2=E4=BB=A5=E6=94=AF=E6=8C=81=E5=AE=89?=
=?UTF-8?q?=E5=85=A8=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 16 --
src/api/system/user.ts | 19 +++
src/types/api/user.ts | 18 ++-
src/views/profile/index.vue | 265 ++++++++++++++++++++++++--------
src/views/system/dict/index.vue | 2 +-
5 files changed, 234 insertions(+), 86 deletions(-)
diff --git a/README.md b/README.md
index 9aec76ff..a0b7f499 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,3 @@
-
vue3-element-admin
diff --git a/src/api/system/user.ts b/src/api/system/user.ts
index ea51e035..1c8be33d 100644
--- a/src/api/system/user.ts
+++ b/src/api/system/user.ts
@@ -7,6 +7,7 @@ import type {
UserProfileDetail,
UserProfileForm,
PasswordChangeForm,
+ PasswordVerifyForm,
MobileUpdateForm,
EmailUpdateForm,
OptionItem,
@@ -193,6 +194,15 @@ const UserAPI = {
});
},
+ /** 解绑手机号 */
+ unbindMobile(data: PasswordVerifyForm) {
+ return request({
+ url: `${USER_BASE_URL}/mobile`,
+ method: "delete",
+ data,
+ });
+ },
+
/** 发送邮箱验证码(绑定或更换邮箱)*/
sendEmailCode(email: string) {
return request({
@@ -211,6 +221,15 @@ const UserAPI = {
});
},
+ /** 解绑邮箱 */
+ unbindEmail(data: PasswordVerifyForm) {
+ return request({
+ url: `${USER_BASE_URL}/email`,
+ method: "delete",
+ data,
+ });
+ },
+
/**
* 获取用户下拉列表
*/
diff --git a/src/types/api/user.ts b/src/types/api/user.ts
index d5e65701..966f9f00 100644
--- a/src/types/api/user.ts
+++ b/src/types/api/user.ts
@@ -108,20 +108,12 @@ export interface UserProfileDetail {
/** 个人中心用户信息表单 */
export interface UserProfileForm {
- /** 用户ID */
- id?: string;
- /** 用户名 */
- username?: string;
/** 用户昵称 */
nickname?: string;
/** 头像URL */
avatar?: string;
/** 性别 */
gender?: number;
- /** 手机号 */
- mobile?: string;
- /** 邮箱 */
- email?: string;
}
/** 修改密码表单 */
@@ -134,12 +126,20 @@ export interface PasswordChangeForm {
confirmPassword?: string;
}
+/** 密码校验表单 */
+export interface PasswordVerifyForm {
+ /** 当前密码 */
+ password?: string;
+}
+
/** 修改手机表单 */
export interface MobileUpdateForm {
/** 手机号 */
mobile?: string;
/** 验证码 */
code?: string;
+ /** 当前密码 */
+ password?: string;
}
/** 修改邮箱表单 */
@@ -148,4 +148,6 @@ export interface EmailUpdateForm {
email?: string;
/** 验证码 */
code?: string;
+ /** 当前密码 */
+ password?: string;
}
diff --git a/src/views/profile/index.vue b/src/views/profile/index.vue
index e93ee9fd..d9e7eb6d 100644
--- a/src/views/profile/index.vue
+++ b/src/views/profile/index.vue
@@ -69,41 +69,9 @@
{{ userProfile.mobile || "未绑定" }}
- handleOpenDialog(DialogType.MOBILE)"
- >
- 更换
-
- handleOpenDialog(DialogType.MOBILE)"
- >
- 绑定
-
{{ userProfile.email || "未绑定" }}
- handleOpenDialog(DialogType.EMAIL)"
- >
- 更换
-
- handleOpenDialog(DialogType.EMAIL)"
- >
- 绑定
-
{{ userProfile.deptName }}
@@ -129,6 +97,66 @@
修改
+
+