feat: 个人中心 - 修改密码

This commit is contained in:
dap
2024-09-03 17:12:27 +08:00
parent 71f137eda3
commit 70fe375e25
3 changed files with 116 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import type { UserProfile } from './model';
import type { UpdatePasswordParam, UserProfile } from './model';
import { requestClient } from '#/api/request';
@@ -30,6 +30,8 @@ export function userProfileUpdate(data: any) {
* @param data
* @returns void
*/
export function userUpdatePassword(data: any) {
return requestClient.put<void>(Api.updatePassword, data, { encrypt: true });
export function userUpdatePassword(data: UpdatePasswordParam) {
return requestClient.putWithMsg<void>(Api.updatePassword, data, {
encrypt: true,
});
}

View File

@@ -62,3 +62,8 @@ export interface UserProfile {
roleGroup: string;
postGroup: string;
}
export interface UpdatePasswordParam {
oldPassword: string;
newPassword: string;
}