添加中断,修复电脑手机运行时信号

This commit is contained in:
2026-07-11 16:56:48 +08:00
parent 9910269733
commit d6437419b1
8 changed files with 211 additions and 138 deletions

View File

@@ -159,7 +159,7 @@ export const useSocketStore = defineStore('socket', () => {
} = messageData || {}
// 调试日志:明确输出 type 和 data
console.log('[handleMessage] type =', type, ', data =', JSON.stringify(data));
console.log(`[handleMessage] type = ${type}, data = ${JSON.stringify(data)}`);
switch (type) {
case 'auth_ok':
@@ -180,6 +180,10 @@ export const useSocketStore = defineStore('socket', () => {
addLog('warn', 'AI正在回复信息')
handleBusinessMessage(data)
break
case 'pc_offline':
addLog('warn', 'PC 端已离线')
break
default:
addLog('info', `未知事件类型: ${type}`)
@@ -252,6 +256,10 @@ export const useSocketStore = defineStore('socket', () => {
if (chunk) {
// 拼接 ai 回复的内容
messageString.value += chunk
if (!isThinking.value) {
console.log("修改状态为开始思考");
isThinking.value = true
}
}
}