refactor: serve static frontend with Go APIs
This commit is contained in:
1 parent
763d2f0648
commit
b14b4fced7
101 files changed
+963
-3928
No files matched your search
+5
-4
@@ -1,8 +1,8 @@
|
||||
import type { Metadata } from "next";
|
||||
import Script from "next/script";
|
||||
import { AppShell } from "@/components/app-shell";
|
||||
import { BrowserAuthProvider } from "@/components/browser-auth";
|
||||
import { randomUUIDPolyfillScript } from "@/lib/client/random-uuid-polyfill";
|
||||
import { getShellAuthState } from "@/lib/server/auth/current-user";
|
||||
import "./globals.css";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
@@ -10,8 +10,7 @@ export const metadata: Metadata = {
|
||||
description: "智念AIGC平台:统一创作图片与视频。"
|
||||
};
|
||||
|
||||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
const auth = await getShellAuthState();
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="zh-CN">
|
||||
<body>
|
||||
@@ -20,7 +19,9 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
strategy="beforeInteractive"
|
||||
dangerouslySetInnerHTML={{ __html: randomUUIDPolyfillScript }}
|
||||
/>
|
||||
<AppShell user={auth.user} authRequired={auth.authRequired} isAdmin={auth.isAdmin} isSuperAdmin={auth.isSuperAdmin}>{children}</AppShell>
|
||||
<BrowserAuthProvider>
|
||||
<AppShell>{children}</AppShell>
|
||||
</BrowserAuthProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user