迁移跳过配置到新结构

This commit is contained in:
mtvpls
2026-01-01 10:01:35 +08:00
parent 9854f60716
commit 761ac4eaf3
11 changed files with 212 additions and 41 deletions

View File

@@ -338,3 +338,4 @@ async function refreshOpenList() {
console.error('OpenList 定时扫描失败:', err);
}
}

View File

@@ -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);