From 419cf3e33197f38be31f369703ffdf1fcf6da972 Mon Sep 17 00:00:00 2001 From: eric Date: Wed, 30 Sep 2026 20:48:58 +0800 Subject: [PATCH] Add platform picker on admin.nomadro.cn before WeChat console. WeChat stays under /wechat unchanged; Douyin opens dyadmin.nomadro.cn. Does not touch nomadro.cn/admin portal. Co-authored-by: Cursor --- apps/ebook/wemini/admin/src/App.tsx | 34 +++++++- .../wemini/admin/src/components/Layout.tsx | 21 +++-- .../ebook/wemini/admin/src/pages/BookEdit.tsx | 2 +- .../wemini/admin/src/pages/Dashboard.tsx | 12 +-- apps/ebook/wemini/admin/src/pages/Login.tsx | 2 +- .../wemini/admin/src/pages/PlatformSelect.tsx | 61 +++++++++++++ apps/ebook/wemini/admin/src/pages/Users.tsx | 2 +- apps/ebook/wemini/admin/src/styles.css | 87 ++++++++++++++++++- 8 files changed, 203 insertions(+), 18 deletions(-) create mode 100644 apps/ebook/wemini/admin/src/pages/PlatformSelect.tsx diff --git a/apps/ebook/wemini/admin/src/App.tsx b/apps/ebook/wemini/admin/src/App.tsx index 68e6675..345307d 100644 --- a/apps/ebook/wemini/admin/src/App.tsx +++ b/apps/ebook/wemini/admin/src/App.tsx @@ -1,6 +1,7 @@ -import { Navigate, Route, Routes } from 'react-router-dom' +import { Navigate, Route, Routes, useParams } from 'react-router-dom' import { getToken } from './api' import Login from './pages/Login' +import PlatformSelect from './pages/PlatformSelect' import Dashboard from './pages/Dashboard' import BookEdit from './pages/BookEdit' import './pages/BookEdit.css' @@ -15,12 +16,35 @@ function Private({ children }: { children: React.ReactNode }) { return <>{children} } +function WechatRedirect({ to }: { to: string }) { + return +} + +function LegacyBookRedirect() { + const { id } = useParams() + return +} + +/** + * https://admin.nomadro.cn — 微信电子书小程序后台(wemini) + * 注意:与门户 https://nomadro.cn/admin 不是同一套系统 + */ export default function App() { return ( } /> + + + + } + /> + + @@ -34,6 +58,14 @@ export default function App() { } /> } /> + + } /> + } /> + } /> + } /> + } /> + + } /> ) } diff --git a/apps/ebook/wemini/admin/src/components/Layout.tsx b/apps/ebook/wemini/admin/src/components/Layout.tsx index 5def8be..6b3e809 100644 --- a/apps/ebook/wemini/admin/src/components/Layout.tsx +++ b/apps/ebook/wemini/admin/src/components/Layout.tsx @@ -1,6 +1,7 @@ import { NavLink, Outlet, useNavigate } from 'react-router-dom' import { clearToken } from '../api' +/** 微信小程序后台壳层 — 仅 /wechat/*,不碰抖音 */ export default function Layout() { const nav = useNavigate() return ( @@ -10,18 +11,24 @@ export default function Layout() { N
Nomadro
-
Admin Console
+
微信小程序后台
+ + + + + + + ) +} diff --git a/apps/ebook/wemini/admin/src/pages/Users.tsx b/apps/ebook/wemini/admin/src/pages/Users.tsx index a625b2d..7c97e3c 100644 --- a/apps/ebook/wemini/admin/src/pages/Users.tsx +++ b/apps/ebook/wemini/admin/src/pages/Users.tsx @@ -101,7 +101,7 @@ export default function Users() {

绑定方案:小程序 wx.login → code2session → openid 作为读者主键;不把微信用户做成 PocketBase - Auth 密码账号。详见 部署清单。 + Auth 密码账号。详见 部署清单。

diff --git a/apps/ebook/wemini/admin/src/styles.css b/apps/ebook/wemini/admin/src/styles.css index e3d01cc..f8d893d 100644 --- a/apps/ebook/wemini/admin/src/styles.css +++ b/apps/ebook/wemini/admin/src/styles.css @@ -238,8 +238,93 @@ th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--lin border-radius: 6px; } +/* 平台选择中间页 */ +.platform-page { + min-height: 100vh; + display: grid; + place-items: center; + padding: 32px 20px; + position: relative; +} +.platform-bg { + position: absolute; + inset: 0; + pointer-events: none; + background: + radial-gradient(700px 420px at 20% 10%, rgba(94, 196, 120, 0.2), transparent 55%), + radial-gradient(600px 380px at 85% 20%, rgba(88, 166, 255, 0.12), transparent 50%); +} +.platform-inner { + position: relative; + width: min(760px, 100%); +} +.platform-brand { + display: flex; + gap: 14px; + align-items: center; + margin-bottom: 28px; +} +.platform-brand h1 { + margin: 0 0 4px; + font-family: var(--font-display); + font-size: 28px; +} +.platform-brand p { + margin: 0; + color: var(--muted); + font-size: 14px; +} +.platform-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 16px; +} +.platform-card { + text-align: left; + border: 1px solid var(--line); + border-radius: 18px; + padding: 22px 20px; + background: rgba(21, 32, 25, 0.88); + color: var(--text); + cursor: pointer; + display: flex; + flex-direction: column; + gap: 8px; + transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; +} +.platform-card:hover { + transform: translateY(-2px); + border-color: rgba(94, 196, 120, 0.45); + box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28); +} +.platform-card--douyin:hover { + border-color: rgba(88, 166, 255, 0.5); +} +.platform-emoji { + font-size: 28px; + line-height: 1; +} +.platform-card strong { + font-family: var(--font-display); + font-size: 20px; +} +.platform-card > span:nth-of-type(2) { + color: var(--muted); + font-size: 13px; + line-height: 1.45; +} +.platform-cta { + margin-top: 10px; + color: var(--accent); + font-weight: 700; + font-size: 14px; +} +.platform-card--douyin .platform-cta { + color: #7eb6ff; +} + @media (max-width: 960px) { .shell { grid-template-columns: 1fr; } .side { border-right: none; border-bottom: 1px solid var(--line); } - .stat-grid, .unlock-hero, .grid-2 { grid-template-columns: 1fr; } + .stat-grid, .unlock-hero, .grid-2, .platform-grid { grid-template-columns: 1fr; } }