feat: 个人中心修改密码

This commit is contained in:
ray
2024-08-14 18:32:59 +08:00
parent 674629269c
commit 4ecae53161
4 changed files with 97 additions and 26 deletions

View File

@@ -74,10 +74,10 @@ class UserAPI {
* @param id 用户ID
* @param password 新密码
*/
static updatePassword(id: number, password: string) {
static resetPassword(id: number, password: string) {
return request({
url: `${USER_BASE_URL}/${id}/password`,
method: "patch",
method: "put",
params: { password: password },
});
}
@@ -153,6 +153,15 @@ class UserAPI {
data: data,
});
}
/** 修改个人中心用户密码 */
static changePassword(data: PasswordChangeForm) {
return request({
url: `${USER_BASE_URL}/password`,
method: "put",
data: data,
});
}
}
export default UserAPI;
@@ -292,3 +301,11 @@ export interface UserProfileForm {
/** 邮箱 */
email?: string;
}
/** 修改密码表单 */
export interface PasswordChangeForm {
/** 原密码 */
oldPassword?: string;
/** 新密码 */
newPassword?: string;
}