| | |
| | | //新建会话 |
| | | // 如果有会话id |
| | | console.log(inputMsg.value, '新建会话名称'); |
| | | |
| | | const res = await addSessionApi({ |
| | | dialog_id: '', |
| | | conversation_desc: inputMsg.value, |
| | |
| | | if (res.code == 200) { |
| | | // console.log(res.data.conversation_id); |
| | | activeSessionId.value = res.data?.conversation_id; |
| | | startChat(inputMsg.value); |
| | | inputMsg.value = ''; |
| | | // queryNewSessionDetail(res.data?.conversation_id); |
| | | const { code, data } = await getSessionDetailsApi(res.data?.conversation_id); |
| | | if (code === 200) { |
| | | console.log(data, '新建会话详情'); |
| | | Object.assign(chatObj, data); |
| | | startChat(inputMsg.value); |
| | | inputMsg.value = ''; |
| | | } |
| | | } else { |
| | | Message.error('创建会话失败,请重试'); |
| | | } |
| | |
| | | sessionDetailList.value = sessionDetailList.value |
| | | .splice(0, sessionDetailList.value.length - 2) |
| | | .concat(lastArr); |
| | | |
| | | console.log(sessionDetailList.value, 'sessionDetailList2'); |
| | | console.log(chatObj, 'chatObj对象'); |
| | | chatObj.message = chatObj.message.concat(lastArr); |