修复导入用户丢失问题

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
-13
View File
@@ -231,19 +231,6 @@ export async function POST(req: NextRequest) {
pass = await db.verifyUserV2(username, password);
userRole = userInfoV2.role;
isBanned = userInfoV2.banned;
} else {
// 回退到旧版本验证
try {
pass = await db.verifyUser(username, password);
// 从配置中获取角色和封禁状态
if (user) {
userRole = user.role;
isBanned = user.banned || false;
}
} catch (err) {
console.error('数据库验证失败', err);
return NextResponse.json({ error: '数据库错误' }, { status: 500 });
}
}
// 检查用户是否被封禁