fix: msg db cache missing shortId

This commit is contained in:
linyuchen 2024-05-04 23:35:19 +08:00
parent f2854fdf00
commit 7e1dee8e07
2 changed files with 3 additions and 2 deletions

View File

@ -154,12 +154,12 @@ class DBUtil {
this.updateMsg(msg).then()
return existMsg.msgShortId
}
this.addCache(msg)
const shortMsgId = await this.genMsgShortId()
const shortIdKey = this.DB_KEY_PREFIX_MSG_SHORT_ID + shortMsgId
const seqIdKey = this.DB_KEY_PREFIX_MSG_SEQ_ID + msg.msgSeq
msg.msgShortId = shortMsgId
this.addCache(msg)
// log("新增消息记录", msg.msgId)
this.db.put(shortIdKey, msg.msgId).then().catch()
this.db.put(longIdKey, JSON.stringify(msg)).then().catch()

View File

@ -225,7 +225,8 @@ export class NTQQFileApi {
// 老的图片url不需要rkey
return IMAGE_HTTP_HOST + url
}
} else if (fileMd5 || md5HexStr) {
}
else if (fileMd5 || md5HexStr) {
// 没有url需要自己拼接
return `${IMAGE_HTTP_HOST}/gchatpic_new/0/0-0-${(fileMd5 || md5HexStr)!.toUpperCase()}/0`
}