Store calculation history on server with bazi input and chart snapshots.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-13 09:57:16 +08:00
parent fcf071cfaa
commit 123a5cce6d
17 changed files with 419 additions and 54 deletions
+11 -2
View File
@@ -13,7 +13,8 @@ export async function middleware(request: NextRequest) {
const { pathname } = request.nextUrl;
const needsAuth =
PROTECTED_PREFIXES.some((p) => pathname === p || pathname.startsWith(`${p}/`)) ||
pathname.startsWith("/api/ai");
pathname.startsWith("/api/ai") ||
pathname.startsWith("/api/history");
if (!needsAuth) {
return NextResponse.next();
@@ -34,5 +35,13 @@ export async function middleware(request: NextRequest) {
}
export const config = {
matcher: ["/liuyao/:path*", "/bazi/:path*", "/combined/:path*", "/history/:path*", "/api/ai"],
matcher: [
"/liuyao/:path*",
"/bazi/:path*",
"/combined/:path*",
"/history/:path*",
"/api/ai",
"/api/history",
"/api/history/:path*",
],
};