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 @@
修改
+
+