fix switch

This commit is contained in:
mtvpls
2026-02-04 00:15:44 +08:00
parent 815f5daa2e
commit 500d5604d9
+5 -1
View File
@@ -37,6 +37,7 @@ export async function POST(request: NextRequest) {
OpenListCacheUsername, OpenListCacheUsername,
OpenListCachePassword, OpenListCachePassword,
OpenListCachePath, OpenListCachePath,
OpenListCacheProxyEnabled,
} = body as { } = body as {
TuneHubEnabled?: boolean; TuneHubEnabled?: boolean;
TuneHubBaseUrl?: string; TuneHubBaseUrl?: string;
@@ -46,6 +47,7 @@ export async function POST(request: NextRequest) {
OpenListCacheUsername?: string; OpenListCacheUsername?: string;
OpenListCachePassword?: string; OpenListCachePassword?: string;
OpenListCachePath?: string; OpenListCachePath?: string;
OpenListCacheProxyEnabled?: boolean;
}; };
// 参数校验 // 参数校验
@@ -57,7 +59,8 @@ export async function POST(request: NextRequest) {
(OpenListCacheURL !== undefined && typeof OpenListCacheURL !== 'string') || (OpenListCacheURL !== undefined && typeof OpenListCacheURL !== 'string') ||
(OpenListCacheUsername !== undefined && typeof OpenListCacheUsername !== 'string') || (OpenListCacheUsername !== undefined && typeof OpenListCacheUsername !== 'string') ||
(OpenListCachePassword !== undefined && typeof OpenListCachePassword !== 'string') || (OpenListCachePassword !== undefined && typeof OpenListCachePassword !== 'string') ||
(OpenListCachePath !== undefined && typeof OpenListCachePath !== 'string') (OpenListCachePath !== undefined && typeof OpenListCachePath !== 'string') ||
(OpenListCacheProxyEnabled !== undefined && typeof OpenListCacheProxyEnabled !== 'boolean')
) { ) {
return NextResponse.json({ error: '参数格式错误' }, { status: 400 }); return NextResponse.json({ error: '参数格式错误' }, { status: 400 });
} }
@@ -82,6 +85,7 @@ export async function POST(request: NextRequest) {
OpenListCacheUsername, OpenListCacheUsername,
OpenListCachePassword, OpenListCachePassword,
OpenListCachePath, OpenListCachePath,
OpenListCacheProxyEnabled,
}; };
// 写入数据库 // 写入数据库