fix : file url

Change-Id: I97ade603d052d9c424a376375fe7fe6065a7afd4
diff --git "a/src/app/community/community-detail/\133communityId\135/page.tsx" "b/src/app/community/community-detail/\133communityId\135/page.tsx"
index 6beb423..e366843 100644
--- "a/src/app/community/community-detail/\133communityId\135/page.tsx"
+++ "b/src/app/community/community-detail/\133communityId\135/page.tsx"
@@ -28,7 +28,7 @@
 import './resource-community.scss';
 
 interface User {
-  Id: number;
+    Id: number;
 }
 // 帖子列表数据
 interface Thread {
@@ -136,9 +136,7 @@
         threadPicture: ''
     });
     // 图片上传消息通知
-    const onUpload = () => {
-        toast.current?.show({ severity: 'info', summary: 'Success', detail: 'File Uploaded' });
-    };
+
 
     // 发帖接口
     const handleSubmit = async () => {
@@ -277,14 +275,27 @@
                     <div className="form-field">
                         <label>封面图片</label>
                         <FileUpload
-                            mode="basic"
-                            name="thread-image"
-                            url={process.env.PUBLIC_URL + "/file"} // 与后端交互的URL
+                            mode="advanced"
+                            name="file"
+                            customUpload
+                            uploadHandler={async (e) => {
+                                const formData = new FormData();
+                                formData.append("file", e.files[0]);
+
+                                try {
+                                    const res = await axios.post(`${process.env.PUBLIC_URL}/file`, formData);
+
+                                    const fileUrl = res.data.url;
+                                    console.log(fileUrl);
+                                    toast.current?.show({ severity: 'success', summary: '上传成功' });
+                                } catch (error) {
+                                    console.log(error);
+                                    toast.current?.show({ severity: 'error', summary: '上传失败' });
+                                }
+                            }}
+                            auto
                             accept="image/*"
-                            maxFileSize={10000000000}
-                            chooseLabel="选择图片"
-                            className="w-full"
-                            onUpload={onUpload}
+                            chooseLabel="上传帖子封面"
                         />
                     </div>
                 </div>