mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-02 16:16:39 +08:00
fix bug cache
This commit is contained in:
parent
bb1ed984d6
commit
d2b9200bc0
@ -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/')) {
|
||||
// 需要确认是管理员
|
||||
|
@ -107,18 +107,18 @@ const ForceCacheHeaders = [
|
||||
]
|
||||
|
||||
if (mode !== "export") {
|
||||
nextConfig.headers = async () => {
|
||||
return [
|
||||
{
|
||||
source: "/:path*\\.(png|ico|txt|css|js|json|webmanifest)",
|
||||
headers: ForceCacheHeaders,
|
||||
},
|
||||
// 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 = [
|
||||
|
Loading…
Reference in New Issue
Block a user