首页增加短剧推荐
This commit is contained in:
@@ -262,6 +262,26 @@ export class DbManager {
|
||||
throw new Error('存储类型不支持清空数据操作');
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- 通用键值存储 ----------
|
||||
async getGlobalValue(key: string): Promise<string | null> {
|
||||
if (typeof (this.storage as any).getGlobalValue === 'function') {
|
||||
return (this.storage as any).getGlobalValue(key);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async setGlobalValue(key: string, value: string): Promise<void> {
|
||||
if (typeof (this.storage as any).setGlobalValue === 'function') {
|
||||
await (this.storage as any).setGlobalValue(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
async deleteGlobalValue(key: string): Promise<void> {
|
||||
if (typeof (this.storage as any).deleteGlobalValue === 'function') {
|
||||
await (this.storage as any).deleteGlobalValue(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 导出默认实例
|
||||
|
||||
Reference in New Issue
Block a user