添加上传图片
This commit is contained in:
1 parent
4556eb71d8
commit
4caa3b061a
7 files changed
+63
-5
No files matched your search
+11
@@ -131,3 +131,14 @@ export const Submission = {
|
||||
return res.data
|
||||
},
|
||||
}
|
||||
|
||||
export const Helper = {
|
||||
async upload(file: File) {
|
||||
const form = new window.FormData()
|
||||
form.append("image", file)
|
||||
const res = await http.post("/upload/", form, {
|
||||
headers: { "content-type": "multipart/form-data" },
|
||||
})
|
||||
return !!res.data.url ? res.data.url : ""
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user