feat: add local auth billing and usage management

This commit is contained in:
inman committed 2026-08-12 12:13:06 +08:00
1 parent f642b5e71f
commit 196fdde83f
119 files changed
+15695 -2650

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
"use client";
import { useEffect } from "react";
export default function BillingError({ reset }: { error: Error & { digest?: string }; reset: () => void }) {
useEffect(() => {
// Keep the error boundary intentionally quiet in production; the API/log layer records the server cause.
}, []);
return (
<main className="billing-route-error">
<div className="billing-route-error-card">
<span className="billing-route-error-kicker">计费中心</span>
<h1>计费服务暂时不可用</h1>
<p>请先刷新页面。如果平台使用 Supabase,请确认已在 SQL Editor 执行最新的 <code>supabase/schema.sql</code>。</p>
<button type="button" onClick={() => reset()}>重新加载</button>
</div>
</main>
);
}
+10
View File
@@ -0,0 +1,10 @@
import { BillingManager } from "@/components/billing-manager";
import { hasSuperAdminAccess } from "@/lib/auth/permissions";
import { requireAppSession } from "@/lib/server/auth/current-user";
export const dynamic = "force-dynamic";
export default async function BillingPage() {
const session = await requireAppSession();
return <BillingManager isSuperAdmin={hasSuperAdminAccess(session.user)} />;
}