Skip to content

Commit 98d4197

Browse files
committed
Update API.
1 parent 2a5a5db commit 98d4197

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/components/widget/Editor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class UploadAdapter {
3939
try {
4040
const { data } = await uploadUserImage(file)
4141
return {
42-
default: `${import.meta.env.VITE_API_BASE_URL}/image/${data.imagePath}`,
42+
default: `${import.meta.env.VITE_API_BASE_URL}/files${data.imagePath}`,
4343
}
4444
} catch (e) {
4545
console.error(e)

src/composes/services/useFiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const useFiles = () => {
1212
const uploadUserImage = async (file) => {
1313
const data = new FormData()
1414
data.append('image', file, file.fileName)
15-
return await request('image', { method: 'post', data })
15+
return await request('files/image', { method: 'post', data })
1616
}
1717

1818
return { uploadUserPhoto, uploadUserImage, ...rest }

src/middlewares/getUser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default async () => {
1515
const { data: user } = await getUser()
1616
state.value.user = {
1717
...user,
18-
avatar: `${import.meta.env.VITE_API_BASE_URL}/photo/profile/${user.id}`,
18+
avatar: `${import.meta.env.VITE_API_BASE_URL}/files/avatar/${user.id}`,
1919
}
2020
} catch (e) {
2121
state.value.user = {}

0 commit comments

Comments
 (0)