feat:完成头像上传的功能

This commit is contained in:
YunaiV
2025-04-22 09:19:19 +08:00
parent fd98752073
commit 1dbbc547fb
14 changed files with 839 additions and 22 deletions

View File

@@ -26,10 +26,11 @@ export namespace SystemUserProfileApi {
/** 更新个人信息请求 */
export interface UpdateProfileReqVO {
nickname: string;
nickname?: string;
email?: string;
mobile?: string;
sex?: number;
avatar?: string;
}
}
@@ -46,11 +47,4 @@ export function updateUserProfile(data: SystemUserProfileApi.UpdateProfileReqVO)
/** 修改用户个人密码 */
export function updateUserPassword(data: SystemUserProfileApi.UpdatePasswordReqVO) {
return requestClient.put('/system/user/profile/update-password', data);
}
/** 上传用户个人头像 */
export function updateUserAvatar(file: File) {
const formData = new FormData();
formData.append('avatarFile', file);
return requestClient.put('/system/user/profile/update-avatar', formData);
}
}