mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
feat: use sqlite instead of lowdb
This commit is contained in:
parent
9c41251164
commit
fd197abb33
22 changed files with 3519 additions and 39 deletions
|
|
@ -1,4 +1,7 @@
|
|||
import * as crypto from 'node:crypto'
|
||||
import path from 'path'
|
||||
import ChatGPTConfig from '../config/config.js'
|
||||
import fs from 'fs'
|
||||
export function md5 (str) {
|
||||
return crypto.createHash('md5').update(str).digest('hex')
|
||||
}
|
||||
|
|
@ -63,3 +66,8 @@ function formatDate (date, format) {
|
|||
function padZero (num) {
|
||||
return num < 10 ? '0' + num : num.toString()
|
||||
}
|
||||
|
||||
export const dataDir = path.resolve('./plugins/chatgpt-plugin', ChatGPTConfig.chaite.dataDir)
|
||||
if (!fs.existsSync(dataDir)) {
|
||||
fs.mkdirSync(dataDir, { recursive: true })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue