fix(ui): 击穿 Next.js 财务数据缓存,强制走势图与真实数据库快照实时对齐
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { reconstructPortfolioHistory } from '@/actions/snapshots';
|
||||
import { revalidatePath } from 'next/cache';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
export const runtime = 'nodejs';
|
||||
@@ -30,6 +31,10 @@ export async function POST(req: Request) {
|
||||
|
||||
console.log('[Rebuild Snapshots] Rebuild complete:', result);
|
||||
|
||||
// 清除整个大盘页面的所有服务端缓存
|
||||
revalidatePath('/', 'layout');
|
||||
revalidatePath('/dashboard', 'page');
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: '历史快照全量重建完成',
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { LayoutGrid, Wallet, ArrowLeftRight } from 'lucide-react';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
export const revalidate = 0;
|
||||
import { ThemeToggle } from '@/components/theme-toggle';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import Link from 'next/link';
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
export const revalidate = 0;
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { ThemeProvider } from "@/components/theme-provider";
|
||||
|
||||
Reference in New Issue
Block a user