Commit 613baad6 by Sixong.Zhu

u

parent 1bd43eff
Showing with 19 additions and 12 deletions
...@@ -16,12 +16,16 @@ export async function getChatModelInfo( ...@@ -16,12 +16,16 @@ export async function getChatModelInfo(
) { ) {
const key = `${modelName}-${id}` const key = `${modelName}-${id}`
if (chatInfo[key] && !forceReload) { if (chatInfo[key] && !forceReload) {
return Promise.resolve({ const d = chatInfo[key];
uniplatId: chatInfo[key].row.UniplatChatId.value, if (d.row && d.row.UniplatChatId) {
chat_id: +chatInfo[key].row.UniplatImChatId.value, return Promise.resolve({
uniplat_version: 0, uniplatId: d.row.UniplatChatId.value,
data: chatInfo[key], chat_id: +d.row.UniplatImChatId.value,
}); uniplat_version: 0,
data: d,
});
}
return Promise.resolve({ uniplatId: 0, chat_id: 0, uniplat_version: 0, data: d });
} }
const info = await Chat.getSdk() const info = await Chat.getSdk()
.model(modelName) .model(modelName)
...@@ -29,10 +33,13 @@ export async function getChatModelInfo( ...@@ -29,10 +33,13 @@ export async function getChatModelInfo(
.query(); .query();
const data = info; const data = info;
chatInfo[key] = data; chatInfo[key] = data;
return { if (info.row && info.row.UniplatChatId) {
uniplatId: info.row.UniplatChatId.value, return {
chat_id: Number(info.row.UniplatImChatId.value), uniplatId: info.row.UniplatChatId.value,
uniplat_version: 0, chat_id: Number(info.row.UniplatImChatId.value),
data, uniplat_version: 0,
}; data,
};
}
return { uniplatId: 0, chat_id: 0, uniplat_version: 0, data, };
} }
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