Skip to content

Commit

Permalink
Update API.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigTows committed Apr 5, 2022
1 parent 2a5a5db commit 98d4197
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/widget/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class UploadAdapter {
try {
const { data } = await uploadUserImage(file)
return {
default: `${import.meta.env.VITE_API_BASE_URL}/image/${data.imagePath}`,
default: `${import.meta.env.VITE_API_BASE_URL}/files${data.imagePath}`,
}
} catch (e) {
console.error(e)
Expand Down
2 changes: 1 addition & 1 deletion src/composes/services/useFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const useFiles = () => {
const uploadUserImage = async (file) => {
const data = new FormData()
data.append('image', file, file.fileName)
return await request('image', { method: 'post', data })
return await request('files/image', { method: 'post', data })
}

return { uploadUserPhoto, uploadUserImage, ...rest }
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/getUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async () => {
const { data: user } = await getUser()
state.value.user = {
...user,
avatar: `${import.meta.env.VITE_API_BASE_URL}/photo/profile/${user.id}`,
avatar: `${import.meta.env.VITE_API_BASE_URL}/files/avatar/${user.id}`,
}
} catch (e) {
state.value.user = {}
Expand Down

0 comments on commit 98d4197

Please sign in to comment.