|
|
@ -19,7 +19,8 @@ |
|
|
<image |
|
|
<image |
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/d7c4e74201213a25dd9574e908233928.svg" |
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/d7c4e74201213a25dd9574e908233928.svg" |
|
|
class="icon" |
|
|
class="icon" |
|
|
@click="goToNotice" @tap="goToNotice" |
|
|
|
|
|
|
|
|
@click="goToNotice" |
|
|
|
|
|
@tap="goToNotice" |
|
|
> |
|
|
> |
|
|
</image> |
|
|
</image> |
|
|
<image |
|
|
<image |
|
|
@ -298,10 +299,8 @@ import { |
|
|
postHistoryDetail, |
|
|
postHistoryDetail, |
|
|
} from "../../api/deepMate/deepMate"; |
|
|
} from "../../api/deepMate/deepMate"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const renderer = new marked.Renderer(); |
|
|
const renderer = new marked.Renderer(); |
|
|
renderer.heading = function(text, level) { |
|
|
|
|
|
|
|
|
renderer.heading = function (text, level) { |
|
|
return `<p>${text}</p>`; |
|
|
return `<p>${text}</p>`; |
|
|
}; |
|
|
}; |
|
|
// 设置 marked 选项 |
|
|
// 设置 marked 选项 |
|
|
@ -628,13 +627,20 @@ const simulateBotResponse = async (userMessage) => { |
|
|
isSending.value = true; |
|
|
isSending.value = true; |
|
|
|
|
|
|
|
|
// 首先进行意图识别 |
|
|
// 首先进行意图识别 |
|
|
const res = await postIntent({ |
|
|
|
|
|
|
|
|
let res; |
|
|
|
|
|
try { |
|
|
|
|
|
res = await postIntent({ |
|
|
content: userMessage, |
|
|
content: userMessage, |
|
|
language: "cn", |
|
|
language: "cn", |
|
|
marketList: "hk,cn,usa,my,sg,vi,in,gb", |
|
|
marketList: "hk,cn,usa,my,sg,vi,in,gb", |
|
|
token: |
|
|
token: |
|
|
"pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q", |
|
|
"pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q", |
|
|
}); |
|
|
}); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
isSending.value = false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
console.log("res" + res); |
|
|
console.log("res" + res); |
|
|
|
|
|
|
|
|
@ -701,31 +707,39 @@ const simulateBotResponse = async (userMessage) => { |
|
|
|
|
|
|
|
|
// 获取股票信息 |
|
|
// 获取股票信息 |
|
|
const StockInfo = await postStock({ |
|
|
const StockInfo = await postStock({ |
|
|
language: 'cn', |
|
|
|
|
|
token: 'pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q', |
|
|
|
|
|
|
|
|
language: "cn", |
|
|
|
|
|
token: |
|
|
|
|
|
"pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q", |
|
|
recordId: Number(recordId), |
|
|
recordId: Number(recordId), |
|
|
parentId: Number(parentId), |
|
|
parentId: Number(parentId), |
|
|
stockId: Number(stockId), |
|
|
stockId: Number(stockId), |
|
|
}); |
|
|
}); |
|
|
console.log('postStock payload', { language: 'cn', token: '790750702588f1ea79f24dc56ccd5d8a', recordId, parentId, stockId }); |
|
|
|
|
|
console.log('StockInfo', StockInfo); |
|
|
|
|
|
|
|
|
console.log("postStock payload", { |
|
|
|
|
|
language: "cn", |
|
|
|
|
|
token: "790750702588f1ea79f24dc56ccd5d8a", |
|
|
|
|
|
recordId, |
|
|
|
|
|
parentId, |
|
|
|
|
|
stockId, |
|
|
|
|
|
}); |
|
|
|
|
|
console.log("StockInfo", StockInfo); |
|
|
|
|
|
|
|
|
const cftl = StockInfo?.cftl || {}; |
|
|
const cftl = StockInfo?.cftl || {}; |
|
|
const date = StockInfo?.date || ''; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const date = StockInfo?.date || ""; |
|
|
|
|
|
|
|
|
if (StockInfo && StockInfo.code !== 200) { |
|
|
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 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?.data?.markdown || '抱歉,未找到该股票'; |
|
|
|
|
|
console.log('StockInfo', StockInfo); |
|
|
|
|
|
|
|
|
const markdown = StockInfo?.data?.markdown || "抱歉,未找到该股票"; |
|
|
|
|
|
console.log("StockInfo", StockInfo); |
|
|
|
|
|
|
|
|
// 添加请求延迟 |
|
|
// 添加请求延迟 |
|
|
// const toDataInfo = await getData(); |
|
|
// const toDataInfo = await getData(); |
|
|
@ -934,9 +948,8 @@ async function itemClick(item) { |
|
|
isThinking: false, |
|
|
isThinking: false, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
onDrawerBackClick() |
|
|
|
|
|
|
|
|
onDrawerBackClick(); |
|
|
messages.value.push(botMsg); |
|
|
messages.value.push(botMsg); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|