flat: ai对话提交
This commit is contained in:
@@ -180,7 +180,7 @@ const useChatGroupDBStore = defineStore("messageGroup", () => {
|
||||
resolve();
|
||||
}
|
||||
|
||||
$api.streamRequest('/chat', params, onDataReceived, onError, onComplete);
|
||||
$api.streamRequest('/app/chat/chat', params, onDataReceived, onError, onComplete);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
reject(err);
|
||||
@@ -230,14 +230,14 @@ const useChatGroupDBStore = defineStore("messageGroup", () => {
|
||||
|
||||
// 云端数据
|
||||
function getHistory() {
|
||||
$api.chatRequest('/app/chat/getChatHistoryList').then((res) => {
|
||||
if (!res.rows.length) return
|
||||
let tabel = parseHistory(res.rows)
|
||||
$api.chatRequest('/app/chat/getHistory').then((res) => {
|
||||
if (!res.data.list.length) return
|
||||
let tabel = parseHistory(res.data.list)
|
||||
if (tabel && tabel.length) {
|
||||
const tabelRow = tabel[0] // 默认第一个
|
||||
const [result, lastData] = insertSortData(tabel)
|
||||
// console.log('getHistory insertSortData', result, lastData)
|
||||
chatSessionID.value = tabelRow.cahtId
|
||||
chatSessionID.value = tabelRow.sessionId
|
||||
tabeList.value = result
|
||||
getHistoryRecord(false)
|
||||
baseDB.db.add(tableName.value, tabel);
|
||||
@@ -250,7 +250,7 @@ const useChatGroupDBStore = defineStore("messageGroup", () => {
|
||||
const params = {
|
||||
sessionId: chatSessionID.value
|
||||
}
|
||||
$api.chatRequest(`/app/chat/getChatDetail/${ chatSessionID.value}`, {}, 'GET', loading).then((res) => {
|
||||
$api.chatRequest('/app/chat/detail', params, 'GET', loading).then((res) => {
|
||||
let list = parseHistoryDetail(res.data.list, chatSessionID.value)
|
||||
if (list.length) {
|
||||
baseDB.db.add(massageName.value, list).then((ids) => {
|
||||
|
||||
Reference in New Issue
Block a user