diff --git a/api/deepExploration/deepExploration.js b/api/deepExploration/deepExploration.js index f3741d1..754ad5e 100644 --- a/api/deepExploration/deepExploration.js +++ b/api/deepExploration/deepExploration.js @@ -1,11 +1,76 @@ import { http } from '@/utils/http.js' -//点击主力追踪 -export const getModel1 = () => { +//主力追踪意图 +export const getModel1First = (data) => { return http({ - method: 'GET', + method: 'POST', url: '/api/coze/trackingFirst', + data + }) +} + +//主力追踪意图 +export const getModel1Second = (data) => { + return http({ + method: 'POST', + url: '/api/coze/trackingSecond', + data + }) +} + + +//主力追踪意图 +export const getModel2First = (data) => { + return http({ + method: 'POST', + url: '/api/coze/radarFirst', + data + }) +} + +//主力追踪意图 +export const getModel2Second = (data) => { + return http({ + method: 'POST', + url: '/api/coze/radarSecond', + data + }) +} + +//主力追踪意图 +export const getModel3First = (data) => { + return http({ + method: 'POST', + url: '/api/coze/decodingFirst', + data + }) +} + +//主力追踪意图 +export const getModel3Second = (data) => { + return http({ + method: 'POST', + url: '/api/coze/decodingSecond', + data + }) +} + +//主力追踪意图 +export const getModel4First = (data) => { + return http({ + method: 'POST', + url: '/api/coze/fundsFirst', + data + }) +} + +//主力追踪意图 +export const getModel4Second = (data) => { + return http({ + method: 'POST', + url: '/api/coze/fundsSecond', + data }) } @@ -28,3 +93,16 @@ export const stocSelectApi = (data) => { }) } + + +//历史记录详情 +export const RecordInfoApi = (data) => { + return http({ + method: 'POST', + url: '/api/coze/clickRecord', + data:data + }) +} + + + diff --git a/api/tcpConnection.js b/api/tcpConnection.js index c701ca3..c31188e 100644 --- a/api/tcpConnection.js +++ b/api/tcpConnection.js @@ -6,7 +6,7 @@ */ // 引用TCP插件 -// const TCPSocket = uni.requireNativePlugin('Aimer-TCPPlugin'); +const TCPSocket = uni.requireNativePlugin('Aimer-TCPPlugin'); // const TCPSocket = uni.requireNativePlugin("Aimer-TCPPlugin"); // TCP连接配置 diff --git a/common/util.js b/common/util.js index 3fbc198..8ef5cb4 100644 --- a/common/util.js +++ b/common/util.js @@ -1,6 +1,6 @@ var util = {} util.data = {} -util.data.base_url = 'https://hwjb.homilychart.com/testApi' +util.data.base_url = 'https://dbqb.nfdxy.net/testApi' // util.data.base_url = 'https://dbqb.nfdxy.net/prodApi' // AJAX 请求方法 diff --git a/components/deepExploration_header.vue b/components/deepExploration_header.vue index 2a63d6a..daae53c 100644 --- a/components/deepExploration_header.vue +++ b/components/deepExploration_header.vue @@ -84,8 +84,12 @@ \ No newline at end of file diff --git a/stores/index.js b/stores/index.js index 354b74d..ada9fd8 100644 --- a/stores/index.js +++ b/stores/index.js @@ -9,5 +9,6 @@ pinia.use(persist) // 导入所有模块 export * from './modules/userInfo' export * from './modules/deviceInfo' +export * from './modules/deepExploration' // 默认导出,给 main.js 使用 export default pinia \ No newline at end of file diff --git a/stores/modules/deepExploration.js b/stores/modules/deepExploration.js new file mode 100644 index 0000000..d326807 --- /dev/null +++ b/stores/modules/deepExploration.js @@ -0,0 +1,44 @@ +import { defineStore } from 'pinia' +import { ref } from 'vue' + +// 定义 Store +export const useDeepExplorationStore = defineStore( + 'deepExploration', + () => { + // 会员信息 + const deepExplorationInfo = ref() + + // 保存会员信息,登录时使用 + const setDeepExplorationInfo = (val) => { + deepExplorationInfo.value = val + } + + // 清理会员信息,退出时使用 + const clearDeepExplorationInfo = () => { + deepExplorationInfo.value = undefined + } + + // 记得 return + return { + deepExplorationInfo, + setDeepExplorationInfo, + clearDeepExplorationInfo, + } + }, + // TODO: 持久化 + { + // 网页端持久化 + // persist: true, + // 小程序端持久化 + persist: { + storage: { + getItem(key) { + return uni.getStorageSync(key) + }, + setItem(key, value) { + uni.setStorageSync(key, value) + }, + }, + }, + }, +) diff --git a/utils/http.js b/utils/http.js index 51668a2..8ffb08f 100644 --- a/utils/http.js +++ b/utils/http.js @@ -1,7 +1,7 @@ import { useUserStore } from "../stores/modules/userInfo" import { useDeviceStore } from "../stores/modules/deviceInfo" -const baseURL = "https://hwjb.homilychart.com/testApi" +const baseURL = "https://dbqb.nfdxy.net/testApi" const httpInterceptor = { @@ -30,15 +30,14 @@ const httpInterceptor = { const deviceInfo =useDeviceStore() - const client = 'ios'; + options.header = { ...options.header, - 'source-client': 'miniapp', // 标准头与文档头同时设置,确保兼容 'content-type': 'application/json', 'contentType': 'application/json', - 'version': '1', - 'client': client, + 'version': uni.getSystemInfoSync().appVersion, + 'client': uni.getSystemInfoSync().platform == 'ios' ? 'ios' : 'android', 'deviceId': deviceInfo.deviceInfo.deviceId } //4 添加token,优先用store,没有则回退到body中的token,保持与Apifox一致