Commit b469c5a8 by panjiangyi

修改创建会话的逻辑

parent 3f8c4d69
Showing with 8 additions and 16 deletions
......@@ -395,30 +395,22 @@ export default {
commit(ChatStore.MUTATION_SCROLL_TO_BOTTOM);
},
async [ChatStore.ACTION_CREATE_NEW_CHAT_BY_SERVICE_MAN](
{ state, commit, dispatch },
{ commit, dispatch },
params: Parameters<ChatStore.ACTION_CREATE_NEW_CHAT_BY_SERVICE_MAN>[0]
) {
const { id } = await sdk()
const { id, ImChatId, uniplat_version } = await sdk()
.model(params.modelName)
.chat(+params.selectedListId)
.createChat();
await new Promise((resolve) => setTimeout(resolve, 500));
const uniplatId = id.value;
const chatId = ImChatId.value;
const v = uniplat_version.value;
await dispatch(ChatStore.ACTION_GET_MY_CHAT_LIST);
const newChatInfo = await getChatModelInfo(
params.modelName,
params.selectedListId
);
const roomList = state[ChatStore.STATE_MY_CHAT_ROOM_LIST];
if (roomList == null) return;
const newChat = roomList.list.find(
(k) => k.chat_id === newChatInfo.chat_id
);
if (newChat == null) return;
commit(ChatStore.MUTATION_SHOW_CHAT);
await dispatch(ChatStore.ACTION_SAVE_CURRENT_CHAT_ID_VERSION, {
chatId: newChat.chat_id,
v: newChatInfo.uniplat_version,
uniplatId: id,
chatId,
v,
uniplatId
});
},
// async [ChatStore.ACTION_CREATE_NEW_CHAT_BY_CLIENT_SIDE](
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment