This commit is contained in:
yanghang
2025-07-09 14:16:51 +08:00
parent f14ae6d5ba
commit c3aea146db
7 changed files with 44 additions and 4 deletions
+2 -2
View File
@@ -5,9 +5,9 @@ ENV = 'development'
# base api
# 苗扬
# VITE_APP_BASE_API_Url = 'http://25.64.16.133:9786'
VITE_APP_BASE_API_Url = 'http://25.64.16.133:9786'
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
# http://25.18.122.65:7001/download/dev-jax.apk
# app入口
#VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
+3
View File
@@ -20,6 +20,7 @@ export default class WebSocketUtil {
this.heartbeatTimer = null; // 心跳计时器
this.heartbeatInterval = options.heartbeatInterval || 30000; // 心跳间隔(ms)
this.heartbeatMsg = options.heartbeatMsg || 'ping'; // 心跳消息
this.isClose = false; // 手动关闭
this.callbacks = {
open: [], // 连接打开回调
message: [], // 消息接收回调
@@ -165,6 +166,7 @@ export default class WebSocketUtil {
* @returns {WebSocketUtil} - 返回当前实例,支持链式调用
*/
close(code = 1000, reason = '') {
this.isClose = true
if (this.socketTask) {
clearInterval(this.heartbeatTimer); // 清除心跳计时器
clearInterval(this.reconnectTimer); // 清除重连计时器
@@ -204,6 +206,7 @@ export default class WebSocketUtil {
* 尝试重新连接WebSocket
*/
tryReconnect() {
if(this.isClose) return
if (this.reconnectCount < this.maxReconnectCount) {
clearInterval(this.reconnectTimer);
this.reconnectTimer = setTimeout(() => {
+9
View File
@@ -143,6 +143,15 @@
"titleNView": false
}
}
},
{
"path": "pages/index/dialog",
"style": {
"navigationBarTitleText": "AI问答",
"app-plus": {
"titleNView": false
}
}
}
],
"tabBar": {
+6 -1
View File
@@ -277,9 +277,13 @@ const nextStep = () => {
const pgrphNum = ref(1)
const showOrder = ref(0)
const isLastPgrph = ref(false)
// 获取段落
const getGraphInfoUnStudy = () => {
if(isLastPgrph.value){
common.msg('您已学完全部知识点!')
return
}
textChartApi({
processType: 'PRGH-STDY',
requestBody: JSON.stringify({
@@ -304,6 +308,7 @@ const getGraphInfoUnStudy = () => {
type: Number(_body.bodyTyp) || 0,
id: _id
}
isLastPgrph.value = _body.chatBody.haveNext !== 'Y'
talkingList.value.push(lastTalkingInfo.value)
pgrphNum.value = _body.chatBody.pgrphNum
showOrder.value = _body.chatBody.showOrder
+9
View File
@@ -0,0 +1,9 @@
<template>
<view>AI问答</view>
</template>
<script>
</script>
<style>
</style>
+9
View File
@@ -17,6 +17,15 @@
"titleNView": false
}
}
},
{
"path": "pages/index/dialog",
"style": {
"navigationBarTitleText": "AI问答",
"app-plus": {
"titleNView": false
}
}
}
]
}
+6 -1
View File
@@ -15,8 +15,13 @@ export const useSocketStore = defineStore('socketStore',{
},
actions:{
creatSocket(){
if(this.SocketObj && this.SocketObj?.close && !this.SocketObj?.isClose) {
return
}
if(this.SocketObj?.isClose){
this.SocketObj.isClose = false
}
let _baseUrl = get_base_url().split('http').join('ws')
if(this.SocketObj && this.SocketObj?.close) return
this.SocketObj = new SocketClass(_baseUrl + '/trastudy/trasoket/open?summary=' + getToken());
},
closeSocket() {