📅  最后修改于: 2022-03-11 14:48:20.508000             🧑  作者: Mango
public static async setAvatar(avatar: ImageFile) {
const userData = await AuthService.getUserData();
return this.handleRequestData(
this.post(
`${ApiUrls.setAvatarImage}/${userData?.id}`,
this.objectToFormData({
user_id: userData?.id,
avatar_url: getFileObjectForImage(avatar),
}),
{ headers: FORM_DATA_HEADER },
),
);
}