fix: 修复积分不足时去充值无法跳转,修正 AI 客服回复重复

This commit is contained in:
2026-10-19 19:31:15 +08:00
parent 39ac3e6996
commit 2d411de7d8
3 changed files with 51 additions and 5 deletions
@@ -73,8 +73,13 @@ module.exports = {
if (p.conversation_id) conversationId = p.conversation_id;
// 处理回答内容
// 注意:conversation.message.completed 携带的是该条消息的完整内容,
// 若前面已经通过 delta 拼过,再拼一次就会重复,这里做去重
if (p.type === 'answer' && p.content) {
answer += p.content;
const isDup = eventName === 'conversation.message.completed' && answer.indexOf(p.content) >= 0;
if (!isDup) {
answer += p.content;
}
// 每积累 200 字更新一次数据库(前端轮询能看到进度)
if (answer.length - lastUpdateLen >= 200) {