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 session = await getToken({ req });
|
||||||
const isUser = await VerifiedUser(session);
|
const isUser = await VerifiedUser(session);
|
||||||
const isAdminUser = await VerifiedAdminUser(session);
|
const isAdminUser = await VerifiedAdminUser(session);
|
||||||
|
console.log('----session', session, '---isUser', isUser, '---isAdmin', isAdminUser)
|
||||||
// 管理员页面的api接口还是要认证的
|
// 管理员页面的api接口还是要认证的
|
||||||
if (path.startsWith('/api/admin/')) {
|
if (path.startsWith('/api/admin/')) {
|
||||||
// 需要确认是管理员
|
// 需要确认是管理员
|
||||||
|
@ -107,18 +107,18 @@ const ForceCacheHeaders = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
if (mode !== "export") {
|
if (mode !== "export") {
|
||||||
nextConfig.headers = async () => {
|
// nextConfig.headers = async () => {
|
||||||
return [
|
// return [
|
||||||
{
|
// {
|
||||||
source: "/:path*\\.(png|ico|txt|css|js|json|webmanifest)",
|
// source: "/:path*\\.(png|ico|txt|css|js|json|webmanifest)",
|
||||||
headers: ForceCacheHeaders,
|
// headers: ForceCacheHeaders,
|
||||||
},
|
// },
|
||||||
// {
|
// {
|
||||||
// source: "/api/:path*",
|
// source: "/api/:path*",
|
||||||
// headers: CorsHeaders,
|
// headers: CorsHeaders,
|
||||||
// },
|
// },
|
||||||
];
|
// ];
|
||||||
};
|
// };
|
||||||
|
|
||||||
nextConfig.rewrites = async () => {
|
nextConfig.rewrites = async () => {
|
||||||
const ret = [
|
const ret = [
|
||||||
|
Loading…
Reference in New Issue
Block a user