mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-05-17 02:57:29 +08:00
feat: auth skip
This commit is contained in:
@@ -120,14 +120,6 @@ function shouldSkipAuth(pathname: string): boolean {
|
|||||||
'/icons/',
|
'/icons/',
|
||||||
'/logo.png',
|
'/logo.png',
|
||||||
'/screenshot.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));
|
return skipPaths.some((path) => pathname.startsWith(path));
|
||||||
@@ -135,5 +127,7 @@ function shouldSkipAuth(pathname: string): boolean {
|
|||||||
|
|
||||||
// 配置middleware匹配规则
|
// 配置middleware匹配规则
|
||||||
export const config = {
|
export const config = {
|
||||||
matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'],
|
matcher: [
|
||||||
|
'/((?!_next/static|_next/image|favicon.ico|api/detail|api/search|api/image-proxy|api/douban).*)',
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user