瀏覽代碼

修改ai链接

yangg 7 月之前
父節點
當前提交
8fb2a83840

+ 2 - 1
.env.development

@@ -2,7 +2,8 @@
 ENV = 'development'
 port = 8080
 # base api
-VUE_APP_BASE_API = 'http://192.168.66.163:8084'
+VUE_APP_BASE_AI_API='https://ylaiapi.raycos.com.cn'
+VUE_APP_BASE_API = 'http://192.168.66.208:8084'
 #192.168.66.208
 #朱:192.168.66.163
 #测试服务器:121.36.251.245

+ 1 - 0
.env.production

@@ -2,6 +2,7 @@
 ENV = 'production'
 port = 8080
 # base api
+VUE_APP_BASE_AI_API='https://ylaiapi.raycos.com.cn'
 VUE_APP_BASE_API = 'http://183.195.216.54:8084'
 #客户:58.246.234.210:8084
 #域名 docapi.shqlsy.com

文件差異過大導致無法顯示
+ 0 - 0
dist/index.html


文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/app.bc24342d.css


+ 0 - 1
dist/static/css/chunk-079de15b.a39facf0.css

@@ -1 +0,0 @@
-.header[data-v-7e826c04]{margin-left:20px}.header h2[data-v-7e826c04]{margin-bottom:0}.center[data-v-7e826c04]{margin:10px}.center[data-v-7e826c04] .el-form--inline .el-form-item{display:block}.center[data-v-7e826c04] .el-input-number--medium{width:150px}.footer[data-v-7e826c04]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;margin:0 100px 20px}[data-v-7e826c04] .avatar-uploader .el-upload{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden}.avatar-uploader .el-upload[data-v-7e826c04]:hover{border-color:#409eff}.avatar-uploader-icon[data-v-7e826c04]{font-size:28px;color:#8c939d;width:100px;height:100px;line-height:100px;text-align:center}.avatar[data-v-7e826c04]{width:100px;height:100px;display:block}.hint[data-v-7e826c04]{font-size:12px;color:#c0c4cc}

+ 1 - 0
dist/static/css/chunk-16a60d86.dd740061.css

@@ -0,0 +1 @@
+.header[data-v-c0880ef0]{margin-left:20px}.header h2[data-v-c0880ef0]{margin-bottom:0}.center[data-v-c0880ef0]{margin:10px}.center[data-v-c0880ef0] .el-form--inline .el-form-item{display:block}.center[data-v-c0880ef0] .el-input-number--medium{width:150px}.footer[data-v-c0880ef0]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;margin:0 100px 20px}[data-v-c0880ef0] .avatar-uploader .el-upload{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden}.avatar-uploader .el-upload[data-v-c0880ef0]:hover{border-color:#409eff}.avatar-uploader-icon[data-v-c0880ef0]{font-size:28px;color:#8c939d;width:100px;height:100px;line-height:100px;text-align:center}.avatar[data-v-c0880ef0]{width:100px;height:100px;display:block}.hint[data-v-c0880ef0]{font-size:12px;color:#c0c4cc}

+ 0 - 1
dist/static/css/chunk-429eba8b.81be44bf.css

@@ -1 +0,0 @@
-.project-search[data-v-a32694b2]{display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px;font-size:12px}.listClass[data-v-a32694b2]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.excel-table[data-v-a32694b2]{width:100%;overflow-y:auto}.excel-table table[data-v-a32694b2]{border-collapse:collapse;width:100%;margin-bottom:20px}.excel-table td[data-v-a32694b2],.excel-table th[data-v-a32694b2]{border:1px solid #ddd;padding:8px;text-align:left;white-space:nowrap}.excel-table th[data-v-a32694b2]{background-color:#f2f2f2;font-weight:700;position:sticky;top:0;z-index:1}.excel-table tr[data-v-a32694b2]:nth-child(2n){background-color:#f9f9f9}.no-data[data-v-a32694b2]{font-size:18px;color:#909399;text-align:center;margin-top:50px}.pagination[data-v-a32694b2]{position:fixed;bottom:0;right:51%}.movable-dialog[data-v-a32694b2]{position:absolute!important}[data-v-a32694b2] .el-dialog__header{cursor:move}

+ 1 - 0
dist/static/css/chunk-620d0711.424a0e4e.css

@@ -0,0 +1 @@
+.project-search[data-v-8ffea030]{display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px;font-size:12px}.listClass[data-v-8ffea030]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.excel-table[data-v-8ffea030]{width:100%;overflow-y:auto}.excel-table table[data-v-8ffea030]{border-collapse:collapse;width:100%;margin-bottom:20px}.excel-table td[data-v-8ffea030],.excel-table th[data-v-8ffea030]{border:1px solid #ddd;padding:8px;text-align:left;white-space:nowrap}.excel-table th[data-v-8ffea030]{background-color:#f2f2f2;font-weight:700;position:sticky;top:0;z-index:1}.excel-table tr[data-v-8ffea030]:nth-child(2n){background-color:#f9f9f9}.no-data[data-v-8ffea030]{font-size:18px;color:#909399;text-align:center;margin-top:50px}.pagination[data-v-8ffea030]{position:fixed;bottom:0;right:51%}.movable-dialog[data-v-8ffea030]{position:absolute!important}[data-v-8ffea030] .el-dialog__header{cursor:move}

文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/chunk-70a4386e.f1ec8666.css


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/app.2489d937.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/app.5ec48652.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/chunk-16a60d86.3b0fda44.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/chunk-429eba8b.05402737.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/chunk-5f2ff500.5ebc1c70.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/chunk-620d0711.dedb4071.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/chunk-70a4386e.203262d0.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/chunk-libs.039883c0.js


+ 25 - 62
src/components/ai.vue

@@ -68,7 +68,7 @@ import LoginModal from "@/components/LoginModal";
 import MarkdownIt from "markdown-it";
 import { pcInnerAi, getMinioURl } from "@/api/api";
 import { modelList, get_default } from "@/api/knowledge";
-import axios from "axios";
+import axios from 'axios';
 const md = new MarkdownIt();
 
 export default {
@@ -279,7 +279,6 @@ export default {
         }
       }
       const chatId = this.getUuid();
-      const wsUrl = `${process.env.VUE_APP_BASE_API}/chatbot/chat`; //this.wsUrl//'http://58.246.234.210:7860/api/v1/run/3ef7369e-b617-40d2-9e2e-54f3ee76ed2e?stream=false'
       let message = this.userInput.trim();
       if (!message) return;
 
@@ -310,72 +309,36 @@ export default {
         botMessage,
         thinkingController.signal
       );
-      // 通过 HTTP 发送消息
+
       try {
-        ///send-message
-        const response = await fetch(`${wsUrl}`, {
-          method: "POST",
-          headers: {
-            "Content-Type": "application/json",
-          },
-          /*  mode: 'no-cors', */
-          /* credentials: "include", */
-          body: JSON.stringify({
-            /*  chatId: chatId, */
-            message: message,
-            /* output_type: "chat",
-              input_type: "chat", */
-            chat_config_id: this.currentChat_id,
-            user_id: this.$store.state.user.id,
-            session_id: this.session_id || "",
-            /* tweaks:this.tweaks  {
-                "ChatInput-U82Vu": {},
-                "Prompt-b8Z1E": {},
-                "OllamaModel-z9SVx": {},
-                "Milvus-l0vvr": {},
-                "OllamaEmbeddings-4Ml5q": {},
-                "ParseData-LM8yW": {},
-                "ParseData-jVoZg": {},
-                "APIRequest-OnZHl": {},
-                "ParseData-fH1vY": {},
-                "ChatOutput-ybzb9": {}
-              } */
-          }),
+        // 直接使用 axios 而不是 this.$axios
+        const response = await axios.post(`${process.env.VUE_APP_BASE_AI_API}/chatbot/chat`, {
+          message: message,
+          chat_config_id: this.currentChat_id,
+          user_id: this.$store.state.user.id,
+          session_id: this.session_id || "",
+          source: "pc",
         });
+
         // 停止思考动画
         thinkingController.abort();
         await thinkingPromise;
-        const result = await response.json();
-        this.session_id = result.data.session_id;
-        if (result.code !== 200) {
-          const errorText = await response.text(); // 获取错误文本
-          throw new Error(
-            `HTTP error! status: ${response.status}, message: ${errorText}`
-          );
-        }
-
-        // 等待思考动画完成
-        await thinkingPromise;
-        if (this.$route.name !== "ai") {
-          // 提取 additional_input 数据
-          const additionalInput = result.data.milvus_ids; //outputs?.[0]?.outputs?.[0]?.results?.message?.data?.additional_input;
 
-          // 处理字符串,提取 ID 值
-          this.idArray = additionalInput; /* .split('\n')  // 按换行符分割
-          .map(line => line.trim())  // 去除每行首尾空白 */
-          /* .filter(line => line.startsWith('ID:'))  // 只保留以 'ID:' 开头的行
-          .map(line => line.substring(3).trim());  // 提取 'ID:' 后面的内容并去除空白 */
-
-          // 创建符合要求格式的对象
-          const idObject = { ids: this.idArray };
-
-          console.log("ID Object:", idObject);
+        if (response.status === 200) {
+          const result = response.data;
+          this.session_id = result.data.session_id;
+          
+          if (this.$route.name !== "ai") {
+            const additionalInput = result.data.milvus_ids;
+            this.idArray = additionalInput;
+            const idObject = { ids: this.idArray };
+            await this.getMinioUrls(idObject);
+          }
 
-          // 调用方法来获取 Minio URL,传递新的 idObject
-          await this.getMinioUrls(idObject);
+          this.handleResponse(result, botMessage);
+        } else {
+          throw new Error(`HTTP error! status: ${response.status}`);
         }
-
-        this.handleResponse(result, botMessage);
       } catch (error) {
         console.error("Error sending message:", error);
         thinkingController.abort();
@@ -385,7 +348,7 @@ export default {
       }
     },
     async getMinioUrls(idObject) {
-      this.minioUrls = []; // 清空前的 URL
+      this.minioUrls = []; // 清空���前的 URL
 
       try {
         console.log("Sending to backend:", JSON.stringify(idObject));
@@ -795,7 +758,7 @@ export default {
   border-radius: 50%; /* 圆形头像 */
   /*background-color: #e9e0e0;  暂时用灰色代替,你可以用图片替换 */
   align-self: start; /* 这将覆盖 flex 容器的 align-items 并将头像对齐到顶部 */
-  margin-right: 10px; /* 按需调整以头像和消息之间提供空间 */
+  margin-right: 10px; /* 按需调整以��头像和消息之间提供空间 */
 }
 
 .user-avatar {

+ 63 - 92
src/components/webAi/js/ChatBox.js

@@ -819,110 +819,81 @@ handleLinkClick(event) {
         }
       }
       const chatId = this.getUuid();
-      const wsUrl =`${process.env.VUE_APP_BASE_API}/chatbot/chat`//this.wsUrl//'http://58.246.234.210:7860/api/v1/run/3ef7369e-b617-40d2-9e2e-54f3ee76ed2e?stream=false'
+      const wsUrl = `${process.env.VUE_APP_BASE_AI_API}/chatbot/chat`
       let message = this.userInput.trim();
       if (message) {
         // 添加用户消息
-      this.messages.push({
-        time: Date.now(),
-        message: message.replace(/(\r\n|\r|\n)/g, "  \n"),
-        messageType: "TEXT",
-        user: "user",
-        done: true,
-      });
-      this.userInput = "";
+        this.messages.push({
+          time: Date.now(),
+          message: message.replace(/(\r\n|\r|\n)/g, "  \n"),
+          messageType: "TEXT",
+          user: "user",
+          done: true,
+        });
+        this.userInput = "";
 
-      // 添加机器人的响应消息
-      const botMessage = {
-        user: "bot",
-        messageType: "TEXT",
-        message: "",
-        html: "",
-        time: Date.now(),
-        done: false,
-      };
-      this.messages.push(botMessage);
+        // 添加机器人的响应消息
+        const botMessage = {
+          user: "bot",
+          messageType: "TEXT",
+          message: "",
+          html: "",
+          time: Date.now(),
+          done: false,
+        };
+        this.messages.push(botMessage);
+
+        // 开始思考动画
+        const thinkingController = new AbortController();
+        const thinkingPromise = this.simulateThinking(
+          botMessage,
+          thinkingController.signal
+        );
 
-      // 开始思考动画
-      const thinkingController = new AbortController();
-      const thinkingPromise = this.simulateThinking(
-        botMessage,
-        thinkingController.signal
-      );
-        // 通过 HTTP 发送消息
         try {
-          ///send-message
-          const response = await fetch(`${wsUrl}`, {
-            method: "POST",
-            headers: {
-              "Content-Type": "application/json"
-            },
-           /*  mode: 'no-cors', */
-            /* credentials: "include", */
-            body: JSON.stringify({
-             /*  chatId: chatId, */
+          const response = await axios({
+            method: 'post',
+            url: wsUrl,
+            data: {
               message: message,
-              /* output_type: "chat",
-              input_type: "chat", */
-              chat_config_id:this.currentChat.id,
-              user_id:this.$store.state.user.id,
-              session_id:this.session_id||''
-             /* tweaks:this.tweaks  {
-                "ChatInput-U82Vu": {},
-                "Prompt-b8Z1E": {},
-                "OllamaModel-z9SVx": {},
-                "Milvus-l0vvr": {},
-                "OllamaEmbeddings-4Ml5q": {},
-                "ParseData-LM8yW": {},
-                "ParseData-jVoZg": {},
-                "APIRequest-OnZHl": {},
-                "ParseData-fH1vY": {},
-                "ChatOutput-ybzb9": {}
-              } */,
-            }),
+              chat_config_id: this.currentChat.id,
+              user_id: this.$store.state.user.id,
+              session_id: this.session_id || '',
+              source: 'pc'
+            }
           });
-           // 停止思考动画
-        thinkingController.abort();
-        await thinkingPromise;
-          const result = await response.json();
-          this.session_id=result.data.session_id
-          console.log(result.status);
-          if (result.code !== 200) {
-            const errorText = await response.text(); // 获取错误文本
-            throw new Error(
-              `HTTP error! status: ${response.status}, message: ${errorText}`
-            );
-          }
 
-          
-         // 等待思考动画完成
-         await thinkingPromise;
-         if(this.$route.name !== 'ai'){
-           // 提取 additional_input 数据
-        const additionalInput = result.data.milvus_ids//outputs?.[0]?.outputs?.[0]?.results?.message?.data?.additional_input;
-        
-        // 处理字符串,提取 ID 值
-        this.idArray = additionalInput/* .split('\n')  // 按换行符分割
-          .map(line => line.trim())  // 去除每行首尾空白 */
-          /* .filter(line => line.startsWith('ID:'))  // 只保留以 'ID:' 开头的行
-          .map(line => line.substring(3).trim());  // 提取 'ID:' 后面的内容并去除空白 */
+          // 停止思考动画
+          thinkingController.abort();
+          await thinkingPromise;
+
+          if (response.status === 200) {
+            const result = response.data;
+            this.session_id = result.data.session_id;
 
-        // 创建符合要求格式的对象
-        const idObject = { ids: this.idArray };
+            if (this.$route.name !== 'ai') {
+              // 提取 additional_input 数据
+              const additionalInput = result.data.milvus_ids;
+              this.idArray = additionalInput;
 
-        console.log("ID Object:", idObject);
+              // 创建符合要求格式的对象
+              const idObject = { ids: this.idArray };
+              console.log("ID Object:", idObject);
 
-        // 调用方法来获取 Minio URL,传递新的 idObject
-        await this.getMinioUrls(idObject);
-         }
-         
-         this.handleResponse(result, botMessage);
-       } catch (error) {
-         console.error("Error sending message:", error);
-         // 如果发生错误,停止思考动画
-         botMessage.done = true;
-         botMessage.message = "抱歉,发生了错误,请稍后再试。";
-       }
+              // 调用方法来获取 Minio URL
+              await this.getMinioUrls(idObject);
+            }
+
+            this.handleResponse(result, botMessage);
+          } else {
+            throw new Error(`HTTP error! status: ${response.status}`);
+          }
+        } catch (error) {
+          console.error("Error sending message:", error);
+          // 如果发生错误,停止思考动画
+          botMessage.done = true;
+          botMessage.message = "抱歉,发生了错误,请稍后再试。";
+        }
       }
     },
     async getMinioUrls(idObject) {

+ 11 - 9
src/views/appConfig/index.vue

@@ -1176,6 +1176,7 @@
             </el-form-item>
           </el-col>
         </el-row>
+
         <el-row :gutter="24">
           <el-col :span="12">
             <el-form-item label="新话题偏好:" prop="presence_penalty">
@@ -2368,23 +2369,23 @@ export default {
         // 处理 role_permissions 和 custom_variables
         this.handleJsonFields();
 
-        // 设置 radio 的值
+        // 设置 radio 的值和处理文档选择
         if (Array.isArray(this.editForm.document_directories)) {
           if (this.editForm.document_directories.length === 0) {
             this.editForm.radio = "2";
+            // 当切换到文档模式且documents为空时,设置为全选
+            if (!this.editForm.documents || this.editForm.documents.length === 0) {
+              this.editForm.documents = ["all"];
+            }
           }
         } else {
           this.editForm.radio = "2";
-        }
-
-        if (Array.isArray(this.editForm.documents)) {
-          if (
-            this.editForm.documents.length === 0 &&
-            this.editForm.radio !== "2"
-          ) {
-            this.editForm.radio = "1";
+          // 当切换到文档模式且documents为空时,设置为全选
+          if (!this.editForm.documents || this.editForm.documents.length === 0) {
+            this.editForm.documents = ["all"];
           }
         }
+
         // 初始化临时存储,保存原始数据
         this.editForm.tempDocuments = Array.isArray(this.editForm.documents)
           ? [...this.editForm.documents]
@@ -2394,6 +2395,7 @@ export default {
         )
           ? [...this.editForm.document_directories]
           : [];
+
         // 并行加载知识库目录列表
         if (
           this.editForm.knowledge_base_names &&

+ 1 - 1
src/views/knowledgeMenu/category/infoList.vue

@@ -27,7 +27,7 @@
           "
         /> -->
         <div
-          style="padding-bottom: 10px"
+          style="padding-bottom: 20px"
           v-html="item.content"
           @click="scrollToPage(item.page_number, item.coordinate)"
         ></div>

+ 31 - 59
src/views/login/aiIndex.vue

@@ -402,17 +402,14 @@ export default {
         }
       }
       const chatId = this.getUuid();
-      const wsUrl = `${process.env.VUE_APP_BASE_API}/chatbot/multimodal`; ///chatbot/chatthis.wsUrl;'http://58.246.234.210:7860/api/v1/run/3ef7369e-b617-40d2-9e2e-54f3ee76ed2e?stream=false'
+      const wsUrl = `${process.env.VUE_APP_BASE_AI_API}/chatbot/multimodal`;
       let message = this.userInput.trim();
-      // 获取所有上传文件的URL并组合成字符串
-      // 修改:直接将图片URL组装成数组
+      
       const imageUrls = this.uploadFiles
         .filter((file) => file.type.startsWith("image/"))
-        .map((file) => file.url); // 直接获取URL数组,不需要join
+        .map((file) => file.url);
 
       if (message || imageUrls.length > 0) {
-        // 修改判断条件,允许只有图片没有文字的情况
-        // Markdown换行处理
         message = message.replace(/(\r\n|\r|\n)/g, "  \n");
 
         this.messages.push({
@@ -424,10 +421,8 @@ export default {
         });
 
         this.userInput = "";
-        // 清空上传的文件
         this.uploadFiles = [];
 
-        // 添加机器人的响应消息
         const botMessage = {
           user: "bot",
           messageType: "TEXT",
@@ -438,84 +433,61 @@ export default {
         };
         this.messages.push(botMessage);
 
-        // 开始思考动画
         const thinkingController = new AbortController();
         const thinkingPromise = this.simulateThinking(
           botMessage,
           thinkingController.signal
         );
 
-        // 通过 HTTP 发送消息
         try {
-          ///send-message
-          const response = await fetch(`${wsUrl}`, {
-            method: "POST",
-            headers: {
-              "Content-Type": "application/json",
-            },
-            body: JSON.stringify({
-              /*  chatId: chatId, */
+          const response = await axios({
+            method: 'post',
+            url: wsUrl,
+            data: {
               message: message,
-              /* output_type: "chat",
-              input_type: "chat", */
-              chat_config_id: "17", //this.currentChat_id,
-              user_id: this.phone, //this.tweaks.Memory-KtRT7.session_id,
+              chat_config_id: "17",
+              user_id: this.phone,
               session_id: this.session_id || "",
+              source: 'pc',
               image_url: imageUrls,
-              history_limit: 10 /* {
-                "ChatInput-U82Vu": {},
-                "Prompt-b8Z1E": {},
-                "OllamaModel-z9SVx": {},
-                "Milvus-l0vvr": {},
-                "OllamaEmbeddings-4Ml5q": {},
-                "ParseData-LM8yW": {},
-                "ParseData-jVoZg": {},
-                "APIRequest-OnZHl": {},
-                "ParseData-fH1vY": {},
-                "ChatOutput-ybzb9": {}
-              } */,
-            }),
+              history_limit: 10
+            }
           });
-          const result = await response.json();
-          this.session_id = result.data.session_id;
-          if (result.code !== 200) {
-            const errorText = await response.text(); // 获取错误文本
-            throw new Error(
-              `HTTP error! status: ${response.status}, message: ${errorText}`
-            );
+
+          this.session_id = response.data.data.session_id;
+          
+          if (response.data.code !== 200) {
+            throw new Error(`HTTP error! status: ${response.status}, message: ${response.data.message}`);
           }
-          // 等待思考动画完成
-          // 停止思考动画
+
           thinkingController.abort();
           await thinkingPromise;
-          if (this.$route.name !== "ai") {
-            // 提取 additional_input 数据
-            const additionalInput = result.data.milvus_ids;
 
-            // 处理字符串,提取 ID 值
+          if (this.$route.name !== "ai") {
+            const additionalInput = response.data.data.milvus_ids;
             this.idArray = additionalInput;
-            /*  .split("\n") // 按换行符分割
-              .map((line) => line.trim()) // 去除每行首尾空白
-              .filter((line) => line.startsWith("ID:")) // 只保留以 'ID:' 开头的行
-              .map((line) => line.substring(3).trim()); // 提取 'ID:' 后面的内容并去除空白 */
-
-            // 创建符合要求格式的对象
             const idObject = { ids: this.idArray };
-
             console.log("ID Object:", idObject);
-
-            // 调用方法来获取 Minio URL,传递新的 idObject
             await this.getMinioUrls(idObject);
           }
 
-          this.handleResponse(result, botMessage);
+          this.handleResponse(response.data, botMessage);
+          
         } catch (error) {
           console.error("Error sending message:", error);
-          // 停止思考动画
           thinkingController.abort();
           await thinkingPromise;
           botMessage.done = true;
           botMessage.message = "抱歉,发生了错误,请稍后再试。";
+          
+          if (error.response) {
+            console.error("Response data:", error.response.data);
+            console.error("Response status:", error.response.status);
+          } else if (error.request) {
+            console.error("No response received:", error.request);
+          } else {
+            console.error("Error message:", error.message);
+          }
         }
       }
     },

+ 9 - 0
vue.config.js

@@ -36,6 +36,15 @@ module.exports = {
       warnings: false,
       errors: true
     },
+    proxy: {
+      '/api': {
+        target: process.env.VUE_APP_BASE_AI_API,
+        changeOrigin: true,
+        pathRewrite: {
+          '^/api': ''
+        }
+      }
+    },
     before: require('./mock/mock-server.js')
   },
   configureWebpack: {

部分文件因文件數量過多而無法顯示