mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-05-19 12:27:29 +08:00
feat: set cached config when import, refactor db
This commit is contained in:
@@ -29,7 +29,7 @@ function createStorage(): IStorage {
|
||||
// 单例存储实例
|
||||
let storageInstance: IStorage | null = null;
|
||||
|
||||
export function getStorage(): IStorage {
|
||||
function getStorage(): IStorage {
|
||||
if (!storageInstance) {
|
||||
storageInstance = createStorage();
|
||||
}
|
||||
@@ -142,6 +142,14 @@ export class DbManager {
|
||||
return this.storage.checkUserExist(userName);
|
||||
}
|
||||
|
||||
async changePassword(userName: string, newPassword: string): Promise<void> {
|
||||
await this.storage.changePassword(userName, newPassword);
|
||||
}
|
||||
|
||||
async deleteUser(userName: string): Promise<void> {
|
||||
await this.storage.deleteUser(userName);
|
||||
}
|
||||
|
||||
// ---------- 搜索历史 ----------
|
||||
async getSearchHistory(userName: string): Promise<string[]> {
|
||||
return this.storage.getSearchHistory(userName);
|
||||
|
||||
Reference in New Issue
Block a user