diff --git a/web/src/components/compose-comment.vue b/web/src/components/compose-comment.vue index e6c9fded..e6fcb469 100644 --- a/web/src/components/compose-comment.vue +++ b/web/src/components/compose-comment.vue @@ -170,15 +170,18 @@ import { parsePostTag } from '@/utils/content'; import type { MentionOption, UploadFileInfo, UploadInst } from 'naive-ui'; const emit = defineEmits<{ - (e: 'post-success'): void + (e: 'post-success'): void; }>(); -const props = withDefaults(defineProps<{ - lock: number, - postId: number, -}>(), { - lock: 0, - postId: 0 -}); +const props = withDefaults( + defineProps<{ + lock: number; + postId: number; + }>(), + { + lock: 0, + postId: 0, + } +); const store = useStore(); @@ -192,7 +195,7 @@ const uploadType = ref('public/image'); const fileQueue = ref([]); const imageContents = ref([]); -const uploadGateway = import.meta.env.VITE_HOST + '/attachment'; +const uploadGateway = import.meta.env.VITE_HOST + '/v1/attachment'; const uploadToken = ref(); // 加载at用户列表 @@ -249,7 +252,10 @@ const beforeUpload = async (data: any) => { return false; } - if (uploadType.value === 'image' && (data.file as any).file?.size > 10485760) { + if ( + uploadType.value === 'image' && + (data.file as any).file?.size > 10485760 + ) { window.$message.warning('图片大小不能超过10MB'); return false; } diff --git a/web/src/components/compose.vue b/web/src/components/compose.vue index db8fca0c..8d5d8771 100644 --- a/web/src/components/compose.vue +++ b/web/src/components/compose.vue @@ -248,7 +248,7 @@ import { parsePostTag } from '@/utils/content'; import type { MentionOption, UploadFileInfo, UploadInst } from 'naive-ui'; const emit = defineEmits<{ - (e: 'post-success', post: Item.PostProps): void + (e: 'post-success', post: Item.PostProps): void; }>(); const store = useStore(); @@ -267,7 +267,7 @@ const imageContents = ref([]); const videoContents = ref([]); const attachmentContents = ref([]); -const uploadGateway = import.meta.env.VITE_HOST + '/attachment'; +const uploadGateway = import.meta.env.VITE_HOST + '/v1/attachment'; const uploadToken = ref(); const switchLink = () => { diff --git a/web/src/views/Setting.vue b/web/src/views/Setting.vue index bf57b588..0567e6cb 100644 --- a/web/src/views/Setting.vue +++ b/web/src/views/Setting.vue @@ -261,7 +261,7 @@ import type { InputInst, } from 'naive-ui'; -const uploadGateway = import.meta.env.VITE_HOST + '/attachment'; +const uploadGateway = import.meta.env.VITE_HOST + '/v1/attachment'; const uploadToken = 'Bearer ' + localStorage.getItem('PAOPAO_TOKEN'); const uploadType = ref('public/avatar');