massive fix

Change-Id: I5972893fc44707bddab7d0014b981ac3097238d6
diff --git "a/src/app/community/community-detail/\133communityId\135/page.tsx" "b/src/app/community/community-detail/\133communityId\135/page.tsx"
index e366843..33011eb 100644
--- "a/src/app/community/community-detail/\133communityId\135/page.tsx"
+++ "b/src/app/community/community-detail/\133communityId\135/page.tsx"
@@ -142,12 +142,13 @@
     const handleSubmit = async () => {
         try {
             const currentDate = new Date().toISOString();
+            console.log(formData);
             const postData = {
                 userId, // 记得用户登录状态获取
                 threadPicture: formData.threadPicture,
                 title: formData.title,
                 content: formData.content,
-                createdAt: currentDate,
+                createAt: currentDate.slice(0, 10),
                 communityId: communityId // 从URL参数获取的社区ID
             };
             // 发送POST请求
@@ -213,7 +214,7 @@
                     {threads.map((thread) => (
                         <Card key={thread.threadId} className="resource-card" onClick={() => router.push(`/community/thread-detail/${thread.threadId}`)}>
                             <Image
-                                src={process.env.NEXT_PUBLIC_NGINX_URL + thread.threadPicture}
+                                src={ thread.threadPicture}
                                 alt={thread.title}
                                 width="368"
                                 height="200"
@@ -285,8 +286,9 @@
                                 try {
                                     const res = await axios.post(`${process.env.PUBLIC_URL}/file`, formData);
 
-                                    const fileUrl = res.data.url;
+                                    const fileUrl = res.data;
                                     console.log(fileUrl);
+                                    setFormData(prev => ({ ...prev, threadPicture: fileUrl }))
                                     toast.current?.show({ severity: 'success', summary: '上传成功' });
                                 } catch (error) {
                                     console.log(error);
diff --git a/src/app/community/page.tsx b/src/app/community/page.tsx
index 81c8a6b..b24242a 100644
--- a/src/app/community/page.tsx
+++ b/src/app/community/page.tsx
@@ -106,7 +106,7 @@
                         width="24"
                         height="24"
                       /></div>
-                    <Image src={process.env.NEXT_PUBLIC_NGINX_URL + item.communityPicture} alt={item.communityName} height="200" className="w-full h-48 object-cover" />
+                    <Image src={item.communityPicture} alt={item.communityName} height="200" className="w-full h-48 object-cover" />
                   </div>
                 }
               >
@@ -165,7 +165,7 @@
         <div className="all-communities-list">
           {communities.map((community) => (
             <Card key={community.communityId} className="all-communities-card" onClick={() => router.push(`/community/community-detail/${community.communityId}`)}>
-              <Image alt="avatar" src={process.env.NEXT_PUBLIC_NGINX_URL + community.communityPicture} className="community-avatar" width="250" height="140" />
+              <Image alt="avatar" src={ community.communityPicture} className="community-avatar" width="250" height="140" />
               <div className="community-header">
                 <div className="community-content">
                   <h3>{community.communityName}</h3>
diff --git "a/src/app/community/resource-community-list/\133category\135/page.tsx" "b/src/app/community/resource-community-list/\133category\135/page.tsx"
index 16f6bd6..cb3e3b0 100644
--- "a/src/app/community/resource-community-list/\133category\135/page.tsx"
+++ "b/src/app/community/resource-community-list/\133category\135/page.tsx"
@@ -111,7 +111,7 @@
             <div className="resource-communities-list">
                 {communities.map((community) => (
                     <Card key={community.communityId} className="resource-communities-list-card" onClick={() => router.push(`/community/community-detail/${community.communityId}`)}>
-                        <Image alt="avatar" src={process.env.NEXT_PUBLIC_NGINX_URL + community.communityPicture} className="community-avatar" width="250" height="140" />
+                        <Image alt="avatar" src={ community.communityPicture} className="community-avatar" width="250" height="140" />
                         <div className="community-header">
                             <div className="community-content">
                                 <h3>{community.communityName}</h3>
diff --git "a/src/app/community/thread-detail/\133threadId\135/page.tsx" "b/src/app/community/thread-detail/\133threadId\135/page.tsx"
index 0f3e5b2..097c35a 100644
--- "a/src/app/community/thread-detail/\133threadId\135/page.tsx"
+++ "b/src/app/community/thread-detail/\133threadId\135/page.tsx"
@@ -59,9 +59,9 @@
 // 新评论接口
 interface NewComment {
     userId: number;
-    threadId: number;
-    resourceId: number;
-    replyId: number;
+    threadId: number | null;
+    resourceId: number | null;
+    replyId: number | null;
     content: string;
     createdAt: string;
 }
@@ -139,7 +139,7 @@
             try {
                 const response = await axios.post(
                     process.env.PUBLIC_URL + `/thread/like`, {
-                    params: { threadId, userId }
+                     threadId, userId
                 }
                 );
                 fetchThreadInfo(); // 刷新帖子信息
@@ -194,7 +194,7 @@
             const pageNumber = first / rows + 1;
             console.log("当前页" + pageNumber + "size" + rows);
             const response = await axios.get<CommentList>(
-                process.env.PUBLIC_URL + `/comments`, {
+                process.env.PUBLIC_URL + `/comment`, {
                 params: { threadId, pageNumber, rows }
             }
             );
@@ -225,10 +225,10 @@
             const newComment: NewComment = {
                 userId,
                 threadId: threadInfo.threadId,
-                resourceId: 0,
+                resourceId: null,
                 replyId: commentId,
                 content: commentValue,
-                createdAt: new Date().toISOString().slice(0, 19).replace('T', ' ')
+                createdAt: new Date().toISOString().slice(0, 10).replace('T', ' ')
             };
 
             const response = await axios.post(process.env.PUBLIC_URL + '/comment', newComment);
@@ -255,10 +255,10 @@
             const newComment: NewComment = {
                 userId,
                 threadId: threadInfo.threadId,
-                resourceId: 0,
-                replyId: 0, // 直接评论,不是回复
+                resourceId: null,
+                replyId: null, // 直接评论,不是回复
                 content: commentValue,
-                createdAt: new Date().toISOString().slice(0, 19).replace('T', ' ')
+                createdAt: new Date().toISOString().slice(0, 10).replace('T', ' ')
             };
 
             const response = await axios.post(process.env.PUBLIC_URL + '/comment', newComment);
@@ -310,7 +310,7 @@
             {/* 帖子头部 */}
             <div className="thread-header">
                 <div className="user-info">
-                    <Avatar image={process.env.NEXT_PUBLIC_NGINX_URL + "users/" + userInfo.avatar} size="large" shape="circle" />
+                    <Avatar image={ "users/" + userInfo.avatar} size="large" shape="circle" />
                     <div className="user-meta">
                         <h3>{userInfo.username}</h3>
                         <span>{userInfo.signature}</span>
@@ -324,7 +324,7 @@
                 <h1>{threadInfo.title}</h1>
                 <div className="content-body">
                     <Image
-                        src={process.env.NEXT_PUBLIC_NGINX_URL + threadInfo.threadPicture}
+                        src={ threadInfo.threadPicture}
                         alt={threadInfo.title}
                         width="800"
                         height="400"
@@ -347,7 +347,7 @@
                     <h2>评论 ({totalComments})</h2>
                 </div>
                 <div className="comments-input">
-                    <Avatar image={process.env.NEXT_PUBLIC_NGINX_URL + "users/" + userInfo.avatar} size="large" shape="circle" />
+                    <Avatar image={ "users/" + userInfo.avatar} size="large" shape="circle" />
                     <InputText value={commentValue} placeholder="发布你的评论" onChange={(e) => setCommentValue(e.target.value)} />
                     <Button label="发布评论" onClick={publishComment} disabled={!commentValue.trim()} />
                 </div>
@@ -356,7 +356,7 @@
                         <div key={comment.commentId} className="comment-item">
                             <div className="comment-user">
                                 <Avatar
-                                    image={comment.userId ? process.env.NEXT_PUBLIC_NGINX_URL + "users/" + commentUserInfos.get(comment.userId)?.avatar : '/default-avatar.png'}
+                                    image={comment.userId ?  "users/" + commentUserInfos.get(comment.userId)?.avatar : '/default-avatar.png'}
                                     size="normal"
                                     shape="circle"
                                 />
@@ -391,7 +391,7 @@
                             </OverlayPanel>
                             <Sidebar className='reply' header={ReplyHeader} visible={visibleReply} position="bottom" onHide={() => setVisibleReply(false)}>
                                 <div className="reply-input">
-                                    <Avatar image={process.env.NEXT_PUBLIC_NGINX_URL + "users/" + userInfo.avatar} size="large" shape="circle" />
+                                    <Avatar image={ "users/" + userInfo.avatar} size="large" shape="circle" />
                                     <InputText value={replyValue} placeholder="发布你的评论" onChange={(e) => setReplyValue(e.target.value)} />
                                     <Button label="发布评论" onClick={() => publishReply(comment.commentId)} disabled={!replyValue.trim()} />
                                 </div>