fix缓存
This commit is contained in:
@@ -91,11 +91,7 @@ export async function GET(request: NextRequest) {
|
||||
generatedAt: new Date().toISOString(),
|
||||
};
|
||||
|
||||
return NextResponse.json(response, {
|
||||
headers: {
|
||||
'Cache-Control': 'public, max-age=3600, s-maxage=3600', // 缓存1小时
|
||||
},
|
||||
});
|
||||
return NextResponse.json(response);
|
||||
} catch (error) {
|
||||
console.error('AI评论生成失败:', error);
|
||||
|
||||
|
||||
@@ -33,13 +33,16 @@ export default function AIComments({ movieName, movieInfo }: AICommentsProps) {
|
||||
const params = new URLSearchParams({
|
||||
name: movieName,
|
||||
count: '10',
|
||||
_t: Date.now().toString(), // 添加时间戳防止缓存
|
||||
});
|
||||
|
||||
if (movieInfo) {
|
||||
params.append('info', movieInfo);
|
||||
}
|
||||
|
||||
const response = await fetch(`/api/ai-comments?${params.toString()}`);
|
||||
const response = await fetch(`/api/ai-comments?${params.toString()}`, {
|
||||
cache: 'no-store', // 禁用缓存
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const data = await response.json();
|
||||
|
||||
@@ -169,6 +169,7 @@ export interface AdminConfig {
|
||||
EnableHomepageEntry: boolean; // 首页入口开关
|
||||
EnableVideoCardEntry: boolean; // VideoCard入口开关
|
||||
EnablePlayPageEntry: boolean; // 播放页入口开关
|
||||
EnableAIComments: boolean; // AI评论生成开关
|
||||
// 权限控制
|
||||
AllowRegularUsers: boolean; // 是否允许普通用户使用AI问片(关闭后仅站长和管理员可用)
|
||||
// 高级设置
|
||||
|
||||
Reference in New Issue
Block a user