修复upstash方式数据导入
This commit is contained in:
@@ -155,8 +155,8 @@ async function getUserPasswordV2(username: string): Promise<string | null> {
|
||||
// 直接调用hGetAll获取完整用户信息(包括密码)
|
||||
const userInfoKey = `user:${username}:info`;
|
||||
|
||||
if (typeof storage.withRetry === 'function' && storage.client?.hGetAll) {
|
||||
const userInfo = await storage.withRetry(() => storage.client.hGetAll(userInfoKey));
|
||||
if (typeof storage.withRetry === 'function' && storage.client?.hgetall) {
|
||||
const userInfo = await storage.withRetry(() => storage.client.hgetall(userInfoKey));
|
||||
if (userInfo && userInfo.password) {
|
||||
return userInfo.password;
|
||||
}
|
||||
|
||||
@@ -149,10 +149,10 @@ export async function POST(req: NextRequest) {
|
||||
}
|
||||
|
||||
// 使用storage.withRetry直接设置用户信息
|
||||
await storage.withRetry(() => storage.client.hSet(userInfoKey, userInfo));
|
||||
await storage.withRetry(() => storage.client.hset(userInfoKey, userInfo));
|
||||
|
||||
// 添加到用户列表
|
||||
await storage.withRetry(() => storage.client.zAdd('user:list', {
|
||||
await storage.withRetry(() => storage.client.zadd('user:list', {
|
||||
score: createdAt,
|
||||
value: username,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user