迁移跳过配置到新结构
This commit is contained in:
@@ -338,3 +338,4 @@ async function refreshOpenList() {
|
||||
console.error('OpenList 定时扫描失败:', err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,17 @@ export async function GET(request: NextRequest) {
|
||||
if (userInfoV2.banned) {
|
||||
return NextResponse.json({ error: '用户已被封禁' }, { status: 401 });
|
||||
}
|
||||
|
||||
// 检查是否需要迁移跳过配置
|
||||
if (!userInfoV2.skip_migrated) {
|
||||
await db.migrateSkipConfigs(authInfo.username);
|
||||
}
|
||||
} else {
|
||||
// 站长也需要检查迁移
|
||||
const userInfoV2 = await db.getUserInfoV2(authInfo.username);
|
||||
if (!userInfoV2?.skip_migrated) {
|
||||
await db.migrateSkipConfigs(authInfo.username);
|
||||
}
|
||||
}
|
||||
|
||||
const { searchParams } = new URL(request.url);
|
||||
|
||||
Reference in New Issue
Block a user