This commit is contained in:
eric
2025-11-13 05:05:53 +08:00
parent cbdc65f56e
commit 891af61146
691 changed files with 83952 additions and 0 deletions

19
app/middleware.ts Normal file
View File

@@ -0,0 +1,19 @@
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
export function middleware(request: NextRequest) {
// 检查是否访问后台路径
if (request.nextUrl.pathname.startsWith('/admin')) {
// TODO: 添加身份验证逻辑
// 例如检查 session、token 等
// 如果未登录,重定向到登录页
// return NextResponse.redirect(new URL('/login', request.url))
}
return NextResponse.next()
}
export const config = {
matcher: '/admin/:path*',
}