mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
✨ feat(tokens): 完成 tokens 的获取
This commit is contained in:
@@ -98,6 +98,24 @@ class TGSqlite {
|
||||
return res[0].value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 保存 appData
|
||||
* @memberof TGSqlite
|
||||
* @since Alpha v0.2.0
|
||||
* @param {string} key
|
||||
* @param {string} value
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
public async saveAppData (key: string, value: string): Promise<void> {
|
||||
const db = await Database.load(this.dbPath);
|
||||
const sql = `
|
||||
INSERT INTO AppData (key, value, updated)
|
||||
VALUES ('${key}', '${value}', datetime('now', 'localtime'))
|
||||
ON CONFLICT(key) DO UPDATE SET value = '${value}', updated = datetime('now', 'localtime');`;
|
||||
await db.execute(sql);
|
||||
await db.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 已有数据表跟触发器不变的情况下,更新数据库数据
|
||||
* @memberof TGSqlite
|
||||
|
||||
Reference in New Issue
Block a user