feat: add global douban proxy config

This commit is contained in:
shinya
2025-07-26 15:39:29 +08:00
parent 090d10e4bb
commit 3de3bd2f39
8 changed files with 155 additions and 17 deletions

View File

@@ -34,12 +34,14 @@ export async function POST(request: NextRequest) {
SearchDownstreamMaxPage,
SiteInterfaceCacheTime,
ImageProxy,
DoubanProxy,
} = body as {
SiteName: string;
Announcement: string;
SearchDownstreamMaxPage: number;
SiteInterfaceCacheTime: number;
ImageProxy: string;
DoubanProxy: string;
};
// 参数校验
@@ -48,7 +50,8 @@ export async function POST(request: NextRequest) {
typeof Announcement !== 'string' ||
typeof SearchDownstreamMaxPage !== 'number' ||
typeof SiteInterfaceCacheTime !== 'number' ||
typeof ImageProxy !== 'string'
typeof ImageProxy !== 'string' ||
typeof DoubanProxy !== 'string'
) {
return NextResponse.json({ error: '参数格式错误' }, { status: 400 });
}
@@ -74,6 +77,7 @@ export async function POST(request: NextRequest) {
SearchDownstreamMaxPage,
SiteInterfaceCacheTime,
ImageProxy,
DoubanProxy,
};
// 写入数据库