From 237128bb78656359c71f72205acf2c8ffe725794 Mon Sep 17 00:00:00 2001 From: wangyetao <2898314561@qq.com> Date: Tue, 28 Oct 2025 13:44:33 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=B0=83poststock=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/deepMate/deepMate.js | 2 +- pages/deepMate/deepMate.vue | 27 +++++++++++++++++---------- utils/http.js | 1 + 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/api/deepMate/deepMate.js b/api/deepMate/deepMate.js index 3fd3d28..1f07d1f 100644 --- a/api/deepMate/deepMate.js +++ b/api/deepMate/deepMate.js @@ -34,7 +34,7 @@ export const postIntent = (data) => { export const postStock = (data) => { return http({ method: 'POST', - url: '/api/coze/decodingSecond', + url: '/testApi/api/coze/decodingSecond', data }) } diff --git a/pages/deepMate/deepMate.vue b/pages/deepMate/deepMate.vue index 3cea576..b3e99e3 100644 --- a/pages/deepMate/deepMate.vue +++ b/pages/deepMate/deepMate.vue @@ -491,17 +491,24 @@ const simulateBotResponse = async (userMessage) => { await new Promise((resolve) => setTimeout(resolve, 2000)); // 获取股票信息 const StockInfo = await postStock({ - recordId: "42", - parentId: "0", - stockId:"42", - token: memberStore.userInfo?.token || '', - language: "cn", + language: 'cn', + token: 'pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q', + recordId: Number(recordId), + parentId: Number(parentId), + stockId: Number(stockId), }); - console.log("StockInfo", StockInfo); - - // if (StockInfo.code !== 200) { - // return ; - // } + console.log('postStock payload', { language: 'cn', token: '790750702588f1ea79f24dc56ccd5d8a', recordId, parentId, stockId }); + console.log('StockInfo', StockInfo); + + if (StockInfo && StockInfo.code !== 200) { + const errMsg = `postStock失败(${StockInfo.code}): ${StockInfo.message || '未知错误'}` + console.warn(errMsg, StockInfo) + messages.value[messages.value.length - 1].isThinking = false + messages.value[messages.value.length - 1].isTyping = false + messages.value[messages.value.length - 1].content = errMsg + isSending.value = false + return + } const markdown = StockInfo.markdown; console.log("StockInfo", StockInfo); diff --git a/utils/http.js b/utils/http.js index 54124b4..6048348 100644 --- a/utils/http.js +++ b/utils/http.js @@ -39,6 +39,7 @@ const httpInterceptor = { //4 添加token,优先用store,没有则回退到body中的token,保持与Apifox一致 const memberStore = useUserStore() // const token = memberStore.userInfo?.token || options.data?.token + options.header.token = '790750702588f1ea79f24dc56ccd5d8a' const token = '790750702588f1ea79f24dc56ccd5d8a' if (token) { options.header.token = token From 77b49d8f6c0856f6c9254a9bb089e80199c1448c Mon Sep 17 00:00:00 2001 From: wangyetao <2898314561@qq.com> Date: Tue, 28 Oct 2025 15:19:24 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=B0=83=E9=80=9Admsecond=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/deepMate/deepMate.js | 4 ++-- utils/http.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/deepMate/deepMate.js b/api/deepMate/deepMate.js index 3adea61..f6374d3 100644 --- a/api/deepMate/deepMate.js +++ b/api/deepMate/deepMate.js @@ -20,7 +20,7 @@ export const getData = () => { export const postIntent = (data) => { return http({ method: 'POST', - url: '/api/deepMate/dmFirst', + url: '/testApi/api/deepMate/dmFirst', data }) } @@ -34,7 +34,7 @@ export const postIntent = (data) => { export const postStock = (data) => { return http({ method: 'POST', - url: '/testApi/api/coze/decodingSecond', + url: '/testApi/api/deepMate/dmSecond', data }) } diff --git a/utils/http.js b/utils/http.js index a446baf..46aaacc 100644 --- a/utils/http.js +++ b/utils/http.js @@ -1,6 +1,6 @@ import { useUserStore } from "../stores/modules/userInfo" -const baseURL = "https://hwjb.homilychart.com/testApi" +const baseURL = "https://hwjb.homilychart.com" const httpInterceptor = { @@ -32,15 +32,15 @@ const httpInterceptor = { 'source-client': 'miniapp', // 标准头与文档头同时设置,确保兼容 'content-type': 'application/json', - // 'contentType': 'application/json', + 'contentType': 'application/json', 'version': '1', 'client': client } //4 添加token,优先用store,没有则回退到body中的token,保持与Apifox一致 const memberStore = useUserStore() // const token = memberStore.userInfo?.token || options.data?.token - options.header.token = '790750702588f1ea79f24dc56ccd5d8a' - const token = '790750702588f1ea79f24dc56ccd5d8a' + options.header.token = 'dccec0b65a94f498b8183a17589ab16e' + const token = 'dccec0b65a94f498b8183a17589ab16e' if (token) { options.header.token = token } From 655141d95e39927a1059262ba828b4c5363cf5a1 Mon Sep 17 00:00:00 2001 From: wangyetao <2898314561@qq.com> Date: Tue, 28 Oct 2025 16:03:57 +0800 Subject: [PATCH 3/4] =?UTF-8?q?markdown=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/deepMate/deepMate.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pages/deepMate/deepMate.vue b/pages/deepMate/deepMate.vue index c75f4d3..acca0a5 100644 --- a/pages/deepMate/deepMate.vue +++ b/pages/deepMate/deepMate.vue @@ -632,6 +632,10 @@ const simulateBotResponse = async (userMessage) => { console.log('postStock payload', { language: 'cn', token: '790750702588f1ea79f24dc56ccd5d8a', recordId, parentId, stockId }); console.log('StockInfo', StockInfo); + const cftl = StockInfo?.cftl || {}; + const date = StockInfo?.date || ''; + + if (StockInfo && StockInfo.code !== 200) { const errMsg = `postStock失败(${StockInfo.code}): ${StockInfo.message || '未知错误'}` console.warn(errMsg, StockInfo) @@ -642,8 +646,8 @@ const simulateBotResponse = async (userMessage) => { return } - const markdown = StockInfo.markdown; - console.log("StockInfo", StockInfo); + const markdown = StockInfo?.data?.markdown || '抱歉,未找到该股票'; + console.log('StockInfo', StockInfo); // 添加请求延迟 // const toDataInfo = await getData(); From 618b66708bf0cd5c2a201d4f3e5e40bb8155904e Mon Sep 17 00:00:00 2001 From: wangyetao <2898314561@qq.com> Date: Tue, 28 Oct 2025 16:35:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/deepMate/deepMate.js | 2 +- pages/deepMate/deepMate.vue | 2 +- utils/http.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/deepMate/deepMate.js b/api/deepMate/deepMate.js index 5c50638..9416772 100644 --- a/api/deepMate/deepMate.js +++ b/api/deepMate/deepMate.js @@ -20,7 +20,7 @@ export const getData = () => { export const postIntent = (data) => { return http({ method: 'POST', - url: '/testApi/api/deepMate/dmFirst', + url: '/api/deepMate/dmFirst', data }) } diff --git a/pages/deepMate/deepMate.vue b/pages/deepMate/deepMate.vue index 5497d58..d4e335e 100644 --- a/pages/deepMate/deepMate.vue +++ b/pages/deepMate/deepMate.vue @@ -640,7 +640,7 @@ const simulateBotResponse = async (userMessage) => { scrollToBottom(); // 字符间延迟,模拟打字效果 - const baseDelay = 5; // 普通字符基础延迟(毫秒) + const baseDelay = 165; // 普通字符基础延迟(毫秒) const slowPunct = /[。!?!?;;]/; // 句号、感叹号、分号等较长停顿 const midPunct = /[,、,::]/; // 逗号、顿号、冒号等中等停顿 const delay = slowPunct.test(ch) diff --git a/utils/http.js b/utils/http.js index 9f443b1..7016a37 100644 --- a/utils/http.js +++ b/utils/http.js @@ -1,6 +1,6 @@ import { useUserStore } from "../stores/modules/userInfo" -const baseURL = "https://hwjb.homilychart.com" +const baseURL = "https://hwjb.homilychart.com/testApi" const httpInterceptor = {