feat: limit endpoint auth

This commit is contained in:
shinya
2025-07-09 22:06:25 +08:00
parent db13b26a8b
commit 7edc673c9f

View File

@@ -140,6 +140,14 @@ function shouldSkipAuth(pathname: string): boolean {
'/icons/',
'/logo.png',
'/screenshot.png',
// 临时开启,后续完整对接后关闭
'/api/detail',
'/api/search',
'/api/search/one',
'/api/search/resources',
'/api/image-proxy',
'/api/douban',
];
return skipPaths.some((path) => pathname.startsWith(path));
@@ -147,5 +155,5 @@ function shouldSkipAuth(pathname: string): boolean {
// 配置middleware匹配规则
export const config = {
matcher: ['/((?!_next/static|_next/image|favicon.ico|api).*)'],
matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'],
};