补充pure用户头像上传功能

This commit is contained in:
tyjctl
2024-09-24 14:44:06 +08:00
parent 38e112fb06
commit 8e66a9880c
5 changed files with 50 additions and 14 deletions

View File

@@ -2,11 +2,15 @@
import type { ResultFile } from "@/api/result";
/** 上传文件*/
export const uploadFile = (data?: object) => {
return http.request<ResultFile>("post", "/file", {
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data
});
export const uploadFile = data => {
return http.request<ResultFile>(
"post",
"/file",
{ data },
{
headers: {
"Content-Type": "multipart/form-data"
}
}
);
};