diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 4aabf4995..d174ef501 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -653,7 +653,7 @@ export default { }, mounted() { - this.msgSubscribe = Store.subscribe('dialogMsgUpdate', this.updateMsg); + this.msgSubscribe = Store.subscribe('dialogMsgChange', this.onMsgChange); }, beforeDestroy() { @@ -1343,11 +1343,15 @@ export default { this.sendMsg(`

${item.label}

`) }, - updateMsg(data) { + onMsgChange(data) { const item = this.allMsgs.find(({type, id}) => type == "text" && id == data.id) if (item) { const {tail} = this.scrollInfo() - item.msg.text = data.text + if (data.type === 'append') { + item.msg.text += data.text + } else if (data.type === 'replace') { + item.msg.text = data.text + } if (tail <= 45) { this.onToBottom() } diff --git a/resources/assets/js/pages/manage/setting/components/SystemAibot.vue b/resources/assets/js/pages/manage/setting/components/SystemAibot.vue index 1b19ac7a9..0cf75fd11 100644 --- a/resources/assets/js/pages/manage/setting/components/SystemAibot.vue +++ b/resources/assets/js/pages/manage/setting/components/SystemAibot.vue @@ -2,24 +2,28 @@
-

{{ $L('ChatGTP') }}

+

ChatGTP

- - + + +
{{$L('访问OpenAI网站查看:')}}https://platform.openai.com/account/api-keys
+
{{$L('例如:http://proxy.com 或 socks5://proxy.com')}}
-

{{ $L('Claude') }}

+

Claude

- + +
{{$L('登录')}} https://claude.ai {{$L('查看 Cookie 中的 sessionKey 便是')}}
+
{{$L('例如:http://proxy.com 或 socks5://proxy.com')}}
diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index c9503c606..88f546117 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -2851,9 +2851,17 @@ export default { */ streamDialogMsg({state, dispatch}, streamUrl) { const sse = new EventSource(streamUrl) - sse.addEventListener("update", e => { - Store.set('dialogMsgUpdate', { + sse.addEventListener("append", e => { + Store.set('dialogMsgChange', { id: e.lastEventId, + type: 'append', + text: e.data + }); + }) + sse.addEventListener("replace", e => { + Store.set('dialogMsgChange', { + id: e.lastEventId, + type: 'replace', text: e.data }); })