fix(02): upload image
This commit is contained in:
parent
59436725f7
commit
7476133bef
2 changed files with 9 additions and 13 deletions
|
|
@ -280,13 +280,14 @@ const useUserStore = defineStore('api-user', () => {
|
|||
},
|
||||
);
|
||||
|
||||
profileImage &&
|
||||
(await axios
|
||||
.put(res.data.profileImageUploadUrl, profileImage, {
|
||||
if (profileImage && res.data.id) {
|
||||
await api
|
||||
.put(`/user/${res.data.id}/image`, profileImage, {
|
||||
headers: { 'Content-Type': profileImage.type },
|
||||
onUploadProgress: (e) => console.log(e),
|
||||
})
|
||||
.catch((e) => console.error(e)));
|
||||
.catch((e) => console.error(e));
|
||||
}
|
||||
|
||||
if (!res) return false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue