首次发布git

This commit is contained in:
2026-02-24 09:53:19 +08:00
commit dd97cf6a2c
71 changed files with 14875 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export default function proxy(request: NextRequest) {
const authCookie = request.cookies.get('auth');
const isLoginPage = request.nextUrl.pathname === '/login';
if (!authCookie && !isLoginPage) {
return NextResponse.redirect(new URL('/login', request.url));
}
if (authCookie && isLoginPage) {
return NextResponse.redirect(new URL('/', request.url));
}
return NextResponse.next();
}
export const config = {
matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],
};