feat: add global image proxy config

This commit is contained in:
shinya
2025-07-15 22:20:42 +08:00
parent cca4092519
commit 90129c0d69
9 changed files with 165 additions and 16 deletions

View File

@@ -33,11 +33,13 @@ export async function POST(request: NextRequest) {
Announcement,
SearchDownstreamMaxPage,
SiteInterfaceCacheTime,
ImageProxy,
} = body as {
SiteName: string;
Announcement: string;
SearchDownstreamMaxPage: number;
SiteInterfaceCacheTime: number;
ImageProxy: string;
};
// 参数校验
@@ -45,7 +47,8 @@ export async function POST(request: NextRequest) {
typeof SiteName !== 'string' ||
typeof Announcement !== 'string' ||
typeof SearchDownstreamMaxPage !== 'number' ||
typeof SiteInterfaceCacheTime !== 'number'
typeof SiteInterfaceCacheTime !== 'number' ||
typeof ImageProxy !== 'string'
) {
return NextResponse.json({ error: '参数格式错误' }, { status: 400 });
}
@@ -70,6 +73,7 @@ export async function POST(request: NextRequest) {
Announcement,
SearchDownstreamMaxPage,
SiteInterfaceCacheTime,
ImageProxy,
};
// 写入数据库