fix bug cache

This commit is contained in:
sijinhui 2024-04-08 10:25:43 +08:00
parent bb1ed984d6
commit d2b9200bc0
2 changed files with 13 additions and 13 deletions

View File

@ -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/')) {
// 需要确认是管理员

View File

@ -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 = [