Sfoglia il codice sorgente

fix: 不能把"回复: "传到后端,否则前台也能看见,改在前端加上"回复: "

kuanghua liu 1 anno fa
parent
commit
b57e477cfa

+ 2 - 2
src/views/system/comments/component/SingleComment.vue

@@ -78,8 +78,8 @@
             type="textarea"
             v-model="replyContent"
             rows="4"
-            resize="none"
             maxlength="200"
+            resize="none"
           >
           </el-input>
           <span v-show="replyContent.length > 185" class="word-count">
@@ -170,7 +170,7 @@
     });
   };
   const submitReply = () => {
-    replyComment({ id: props.problemData.id, reply: '回复: ' + replyContent.value }).then(() => {
+    replyComment({ id: props.problemData.id, reply: replyContent.value }).then(() => {
       openReply.value = false;
       emit('reFreshList');
     });

+ 4 - 0
src/views/system/comments/use-comments.ts

@@ -33,6 +33,10 @@ export function useCommentsList() {
     }
     getCommentsList(params).then((res) => {
       commentsList.value = res.records;
+      // 若有回复,将回复内容前面加上“回复:”
+      commentsList.value.forEach((item) => {
+        item.reply = '回复: ' + item.reply;
+      });
       totalPage.value = res.totalPage;
       totalRow.value = res.totalRow;
     });