Pārlūkot izejas kodu

feat: 调整接口

zhangyuhan 8 mēneši atpakaļ
vecāks
revīzija
c2bff5f1c6
1 mainītis faili ar 5 papildinājumiem un 9 dzēšanām
  1. 5 9
      social-mobile/src/views/Home.vue

+ 5 - 9
social-mobile/src/views/Home.vue

@@ -79,11 +79,11 @@ import {
   getUserDataInfo,
   createChatSession,
   robotInfo,
-  findAIAnswer,
   customerEval,
   getNode,
   appraiseMessage,
-  getTouristInfo
+  getTouristInfo,
+  findAnswer
 } from '@/api/modules'
 import { Popup, Loading, Overlay } from 'vant'
 import EventBus from '@/utils/eventBus'
@@ -1445,21 +1445,17 @@ export default {
       if (manMade.includes(data.question)) {
         // this.setCustomer('2')
       } else {
-        const params = {
-          prompt: data?.question,
-          href: location.origin
-        }
         setTimeout(() => {
-          findAIAnswer(params).then(res => {
+          findAnswer(data).then(res => {
             if (res && res.error_code === 0) {
               if (res.error_msg && !res.data) {
                 this.socketsend(res.error_msg, 'robotText', 1)
               } else if (JSON.stringify(res.data) === '{}') {
                 this.socketsend(this.robotInfoObj.reply03.Content, 'robotText', 1)
               } else {
-                res.data.answer = res.data.reply?.replace('target="_blank"', '')
+                res.data.answer = res.data.answer?.replace('target="_blank"', '')
                 // 传‘answer’代表机器人返回的有答案,可以进行评价
-                this.socketsend(res.data.reply, 'robotText', 1, 'answer')
+                this.socketsend(res.data.answer, 'robotText', 1, 'answer')
               }
             } else {
               this.socketsend(this.robotInfoObj.reply03.Content, 'robotText', 1)