fix: update not upload file

This commit is contained in:
Methapon2001 2023-12-13 13:53:53 +07:00
parent ec99336bf3
commit bc3b8f9ca7
No known key found for this signature in database
GPG key ID: 849924FEF46BD132

View file

@ -420,7 +420,7 @@ const useStorage = defineStore('storageStore', () => {
constructUrl(arr.slice(0, -1), false) + `/file/${arr[arr.length - 1]}`,
{ file: file?.name, ...data },
)
if (res && res.status === 201 && res.data && res.data.upload) {
if (res && res.status === 200 && res.data && res.data.upload) {
await axios
.put(res.data.upload, file, {
headers: { 'Content-Type': file?.type },