修复导入用户丢失问题

This commit is contained in:
mtvpls
2025-12-31 23:27:15 +08:00
parent 52d84942ad
commit c2442d03a6
11 changed files with 8 additions and 80 deletions
+1 -5
View File
@@ -132,11 +132,7 @@ export class DbManager {
return favorite !== null;
}
// ---------- 用户相关(旧版本,保持兼容) ----------
async registerUser(userName: string, password: string): Promise<void> {
await this.storage.registerUser(userName, password);
}
async verifyUser(userName: string, password: string): Promise<boolean> {
return this.storage.verifyUser(userName, password);
}
-5
View File
@@ -492,11 +492,6 @@ export abstract class BaseRedisStorage implements IStorage {
return `u:${user}:pwd`;
}
async registerUser(userName: string, password: string): Promise<void> {
// 简单存储明文密码,生产环境应加密
await this.withRetry(() => this.client.set(this.userPwdKey(userName), password));
}
async verifyUser(userName: string, password: string): Promise<boolean> {
const stored = await this.withRetry(() =>
this.client.get(this.userPwdKey(userName))
-1
View File
@@ -53,7 +53,6 @@ export interface IStorage {
migrateFavorites(userName: string): Promise<void>;
// 用户相关
registerUser(userName: string, password: string): Promise<void>;
verifyUser(userName: string, password: string): Promise<boolean>;
// 检查用户是否存在(无需密码)
checkUserExist(userName: string): Promise<boolean>;
-5
View File
@@ -393,11 +393,6 @@ export class UpstashRedisStorage implements IStorage {
return `u:${user}:pwd`;
}
async registerUser(userName: string, password: string): Promise<void> {
// 简单存储明文密码,生产环境应加密
await withRetry(() => this.client.set(this.userPwdKey(userName), password));
}
async verifyUser(userName: string, password: string): Promise<boolean> {
const stored = await withRetry(() =>
this.client.get(this.userPwdKey(userName))