Browse Source

修改接口

yangg 5 months ago
parent
commit
8add2717b5
1 changed files with 8 additions and 7 deletions
  1. 8 7
      src/views/report.vue

+ 8 - 7
src/views/report.vue

@@ -469,11 +469,11 @@ let rotationInterval = null;
 const fetchDocumentSummary = async () => {
   isLoadingSummary.value = true;
   try {
-    const response = await axios.get(`http://192.168.66.187:8084/document/content/query/`);
+    const response = await axios.get(`${import.meta.env.VITE_BASE_AI_API}/api/document/summary`);
     console.log('API Response:', response.data);
     
     if (response.data.code === 200) {
-      documentSummary.value = response.data.data;
+      documentSummary.value = response.data.data.items;
       console.log('Document Summary:', documentSummary.value);
       startRotation();
     }
@@ -499,8 +499,9 @@ const startRotation = () => {
     // 处理第一项数据(Hot Topics)
     try {
       const hotTopicsData = documentSummary.value[0];
-      if (hotTopicsData?.qa_pairs) {
-        const parsedQaPairs = JSON.parse(hotTopicsData.qa_pairs.replace(/'/g, '"'));
+      console.log(hotTopicsData);
+      if (hotTopicsData?.questions) {
+        const parsedQaPairs = /* JSON.parse( */hotTopicsData.questions/* .replace(/'/g, '"')); */
         const formattedQaPairs = parsedQaPairs.map(question => ({ question }));
         // 随机选择3个问题
         const shuffled = [...formattedQaPairs].sort(() => 0.5 - Math.random());
@@ -513,8 +514,8 @@ const startRotation = () => {
     // 处理第二项数据(Design Guide)
     try {
       const designGuideData = documentSummary.value[1];
-      if (designGuideData?.qa_pairs) {
-        const parsedGuides = JSON.parse(designGuideData.qa_pairs.replace(/'/g, '"'));
+      if (designGuideData?.questions) {
+        const parsedGuides = /* JSON.parse( */designGuideData.questions/* .replace(/'/g, '"')); */
         const formattedGuides = parsedGuides.map(question => ({ question }));
         // 随机选择3个指南
         const shuffled = [...formattedGuides].sort(() => 0.5 - Math.random());
@@ -1558,7 +1559,7 @@ const renderMarkdown = (content) => {
   padding: 8px 12px;
   background: #f5f5f5;
   border-radius: 4px;
-  font-size: 14px;
+  font-size: 12px;
   color: rgba(0, 0, 0, 0.88);
   display: flex;
   align-items: center;