diff --git a/.env.example b/.env.example index 21b1a93..1b0fe2e 100644 --- a/.env.example +++ b/.env.example @@ -3,5 +3,5 @@ # ============================================================================= # 必填:Laravel 应用根 URL(无尾部斜杠)。axios 会请求 {此地址}/api/v1/... -# 需保证 Laravel 已允许该来源的 CORS(本地一般为 http://localhost:3000 等)。 +# 需保证 Laravel 已允许该来源的 CORS(本地管理端为 http://localhost:3801 等)。 NEXT_PUBLIC_LOTTERY_API_BASE_URL=http://127.0.0.1:8000 diff --git a/README.md b/README.md index e215bc4..320d09f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ pnpm dev bun dev ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +Open [http://localhost:3801](http://localhost:3801) with your browser to see the result. You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. diff --git a/package.json b/package.json index a23e8db..ec00b11 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev", + "dev": "next dev --port 3801", "build": "next build", "start": "next start", "lint": "eslint" diff --git a/src/lib/admin-datetime.ts b/src/lib/admin-datetime.ts index bd883ef..d4eea5d 100644 --- a/src/lib/admin-datetime.ts +++ b/src/lib/admin-datetime.ts @@ -9,10 +9,11 @@ function pad2(n: number): string { */ export function formatAdminInstant( iso: string | null | undefined, - _options: { + options: { locale: AdminApiLocale; }, ): string { + void options; if (iso == null || iso === "") { return "—"; } diff --git a/src/modules/config/config-workspace-shell.tsx b/src/modules/config/config-workspace-shell.tsx index f8f92e6..c981b3f 100644 --- a/src/modules/config/config-workspace-shell.tsx +++ b/src/modules/config/config-workspace-shell.tsx @@ -1,13 +1,11 @@ "use client"; -import { useMemo } from "react"; import type { ReactNode } from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { cn } from "@/lib/utils"; import { CONFIG_NAV_GROUPS } from "@/modules/config/config-nav-model"; -import { configHubMeta } from "@/modules/config/meta"; function navLinkActive(pathname: string, href: string): boolean { return pathname === href || pathname.startsWith(`${href}/`); @@ -15,20 +13,6 @@ function navLinkActive(pathname: string, href: string): boolean { export function ConfigWorkspaceShell({ children }: { children: ReactNode }) { const pathname = usePathname() ?? ""; - const activeNav = useMemo(() => { - for (const group of CONFIG_NAV_GROUPS) { - for (const item of group.items) { - if (navLinkActive(pathname, item.href)) { - return { group, item }; - } - } - } - return null; - }, [pathname]); - - const title = activeNav?.item.title ?? configHubMeta.title; - const description = activeNav?.item.description || configHubMeta.description; - const groupLabel = activeNav?.group.label ?? "总览"; return (