Browse Source

Merge branch 'dongqian/feature-20251022181325-deepmate简版' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into wangyi/feature-20251026183100-deepmate王毅

lihuilin/feature-20251024095243-我的
Ethereal 4 weeks ago
parent
commit
f52fafc18d
  1. 15
      pages/deepMate/deepMate.vue
  2. 14
      utils/http.js

15
pages/deepMate/deepMate.vue

@ -604,10 +604,9 @@ const simulateBotResponse = async (userMessage) => {
//
const res = await postIntent({
content: userMessage,
language: "cn",
marketList: "hk,cn,usa,my,sg,vi,in,gb",
token:
"pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q",
language: 'cn',
marketList: 'hk,cn,usa,my,sg,vi,in,gb',
token: "pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q",
});
console.log("res" + res);
@ -624,10 +623,10 @@ const simulateBotResponse = async (userMessage) => {
//
const StockInfo = await postStock({
recordId,
parentId,
stockId,
token: memberStore.userInfo?.token || "",
recordId: "42",
parentId: "0",
stockId:"42",
token: memberStore.userInfo?.token || '',
language: "cn",
});
console.log("StockInfo", StockInfo);

14
utils/http.js

@ -1,4 +1,4 @@
import { useUserStore } from "../stores/modules/userInfo/"
import { useUserStore } from "../stores/modules/userInfo"
const baseURL = "https://hwjb.homilychart.com/testApi"
@ -32,17 +32,19 @@ const httpInterceptor = {
'source-client': 'miniapp',
// 标准头与文档头同时设置,确保兼容
'content-type': 'application/json',
// 'contentType': 'application/json',
'version': '1',
'client': client,
'token': '790750702588f1ea79f24dc56ccd5d8a'
'client': client
}
//4 添加token
//4 添加token,优先用store,没有则回退到body中的token,保持与Apifox一致
const memberStore = useUserStore()
// const token = memberStore.userInfo?.token
// const token = memberStore.userInfo?.token || options.data?.token
const token = '790750702588f1ea79f24dc56ccd5d8a'
if (token) {
options.header.Authorization = token
options.header.token = token
}
// 避免误用 Authorization 头,后端要求的是 token 头
// if (options.header.Authorization) delete options.header.Authorization
return options
}
}

Loading…
Cancel
Save