refactor: serve static frontend with Go APIs

This commit is contained in:
brother7 committed 2026-08-16 20:47:45 +08:00
1 parent 763d2f0648
commit b14b4fced7
101 files changed
+963 -3928

No files matched your search

+9 -6
View File
@@ -1,14 +1,17 @@
"use client";
import { SettingsPanel } from "@/components/settings-panel";
import { hasSuperAdminAccess } from "@/lib/auth/permissions";
import { requireAppSession } from "@/lib/server/auth/current-user";
import { BrowserAuthGuard, useBrowserAuth } from "@/components/browser-auth";
export const dynamic = "force-dynamic";
export default function SettingsPage() {
return <BrowserAuthGuard><SettingsContent /></BrowserAuthGuard>;
}
export default async function SettingsPage() {
const session = await requireAppSession();
function SettingsContent() {
const { isSuperAdmin } = useBrowserAuth();
return (
<div className="settings-page-stack">
{hasSuperAdminAccess(session.user) ? <SettingsPanel /> : (
{isSuperAdmin ? <SettingsPanel /> : (
<section className="panel">
<h2>系统设置</h2>
<p className="muted">系统配置仅由超级管理员维护。</p>