diff --git a/middleware.ts b/middleware.ts index fb7459b98..dce7a2527 100644 --- a/middleware.ts +++ b/middleware.ts @@ -18,7 +18,7 @@ export default async function middleware(req: NextRequest) { const session = await getToken({ req }); const isUser = await VerifiedUser(session); const isAdminUser = await VerifiedAdminUser(session); - + console.log('----session', session, '---isUser', isUser, '---isAdmin', isAdminUser) // 管理员页面的api接口还是要认证的 if (path.startsWith('/api/admin/')) { // 需要确认是管理员 diff --git a/next.config.mjs b/next.config.mjs index a56946cc3..01595bd19 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -107,18 +107,18 @@ const ForceCacheHeaders = [ ] if (mode !== "export") { - nextConfig.headers = async () => { - return [ - { - source: "/:path*\\.(png|ico|txt|css|js|json|webmanifest)", - headers: ForceCacheHeaders, - }, - // { - // source: "/api/:path*", - // headers: CorsHeaders, - // }, - ]; - }; + // nextConfig.headers = async () => { + // return [ + // { + // source: "/:path*\\.(png|ico|txt|css|js|json|webmanifest)", + // headers: ForceCacheHeaders, + // }, + // { + // source: "/api/:path*", + // headers: CorsHeaders, + // }, + // ]; + // }; nextConfig.rewrites = async () => { const ret = [