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] =?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