flat: 暂存

This commit is contained in:
Apcallover
2025-11-18 19:43:15 +08:00
parent ca7273f152
commit 60a0448aa7
7 changed files with 15 additions and 21 deletions

View File

@@ -230,14 +230,14 @@ const useChatGroupDBStore = defineStore("messageGroup", () => {
// 云端数据
function getHistory() {
$api.chatRequest('/getHistory').then((res) => {
if (!res.data.list.length) return
let tabel = parseHistory(res.data.list)
$api.chatRequest('/app/chat/getChatHistoryList').then((res) => {
if (!res.rows.length) return
let tabel = parseHistory(res.rows)
if (tabel && tabel.length) {
const tabelRow = tabel[0] // 默认第一个
const [result, lastData] = insertSortData(tabel)
// console.log('getHistory insertSortData', result, lastData)
chatSessionID.value = tabelRow.sessionId
chatSessionID.value = tabelRow.cahtId
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('/detail', params, 'GET', loading).then((res) => {
$api.chatRequest(`/app/chat/getChatDetail/${ chatSessionID.value}`, {}, 'GET', loading).then((res) => {
let list = parseHistoryDetail(res.data.list, chatSessionID.value)
if (list.length) {
baseDB.db.add(massageName.value, list).then((ids) => {