mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
fix: sqlite api
This commit is contained in:
parent
0c602d6cb3
commit
64c77877ac
6 changed files with 86 additions and 0 deletions
|
|
@ -249,7 +249,16 @@ export class SQLiteChannelStorage extends ChaiteStorage {
|
|||
*/
|
||||
async setItem (id, channel) {
|
||||
await this.ensureInitialized()
|
||||
if (!id) {
|
||||
id = this._generateId()
|
||||
}
|
||||
|
||||
// 加上时间戳
|
||||
if (!channel.createdAt) {
|
||||
channel.createdAt = new Date().toISOString()
|
||||
}
|
||||
|
||||
channel.updatedAt = new Date().toISOString()
|
||||
// 转换为数据库记录
|
||||
const record = this._channelToRecord(channel)
|
||||
record.id = id // 确保ID是指定的ID
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue