From 8f48b96fdcf980bf7ecb28b50e83693e7bcd74b9 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Sun, 5 Jul 2026 12:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=8C=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- web/backend/main.py | 2 +- web/frontend/index.html | 2 +- web/frontend/src/layouts/MainLayout.tsx | 52 +- web/frontend/src/pages/DashboardPage.tsx | 217 ++++++-- web/frontend/src/pages/HuyaTasksPage.tsx | 631 ++++++++++++----------- web/frontend/src/pages/LoginPage.tsx | 2 +- 7 files changed, 545 insertions(+), 363 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 566ac5f..5aefcf1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "douyu-login-py" version = "0.2.0" -description = "斗鱼批量登录 Web 后台" +description = "直播账号运营 Web 后台" readme = "README.md" requires-python = ">=3.12,<3.13" dependencies = [ diff --git a/web/backend/main.py b/web/backend/main.py index d809224..08cd896 100644 --- a/web/backend/main.py +++ b/web/backend/main.py @@ -29,7 +29,7 @@ async def lifespan(app: FastAPI): app = FastAPI( - title="斗鱼批量登录后台", + title="直播运营后台", version=get_app_version(), lifespan=lifespan, ) diff --git a/web/frontend/index.html b/web/frontend/index.html index 0fca6f0..64d1845 100644 --- a/web/frontend/index.html +++ b/web/frontend/index.html @@ -4,7 +4,7 @@ - frontend + 直播运营后台
diff --git a/web/frontend/src/layouts/MainLayout.tsx b/web/frontend/src/layouts/MainLayout.tsx index 0d400f2..daafea0 100644 --- a/web/frontend/src/layouts/MainLayout.tsx +++ b/web/frontend/src/layouts/MainLayout.tsx @@ -1,10 +1,11 @@ import { useEffect, useState } from 'react'; import { Layout, Menu, Avatar, Space, Typography, Button, Modal, Dropdown } from 'antd'; +import type { MenuProps } from 'antd'; import { DashboardOutlined, UserOutlined, LogoutOutlined, CloudServerOutlined, TeamOutlined, ApiOutlined, KeyOutlined, MenuFoldOutlined, MenuUnfoldOutlined, SwapOutlined, - SunOutlined, MoonOutlined, DesktopOutlined, GiftOutlined, ShoppingCartOutlined, + SunOutlined, MoonOutlined, DesktopOutlined, GiftOutlined, ShoppingCartOutlined, ApartmentOutlined, } from '@ant-design/icons'; import { useNavigate, useLocation, Outlet } from 'react-router-dom'; import { getUser, clearAuth, type AuthUser } from '../store/auth'; @@ -44,49 +45,52 @@ export default function MainLayout({ onLogout }: { onLogout?: () => void }) { if (!user) return null; - const menuItems: { key: string; label: string; icon: React.ReactNode }[] = []; + const menuItems: MenuProps['items'] = []; + const douyuItems: NonNullable = []; + const huyaItems: NonNullable = []; + const systemItems: NonNullable = []; // Dashboard - 所有人可见 menuItems.push({ key: '/', label: '概览', icon: }); - // 账号管理 + // 斗鱼 if (canAny(['account:view_all', 'account:view_assigned'])) { - menuItems.push({ key: '/accounts', label: '账号管理', icon: }); + douyuItems.push({ key: '/accounts', label: '账号管理', icon: }); } - - // 分配管理 if (can('account:assign')) { - menuItems.push({ key: '/assignments', label: '分配管理', icon: }); + douyuItems.push({ key: '/assignments', label: '分配管理', icon: }); } - - // 登录任务 if (canAny(['login:batch', 'login:view_all'])) { - menuItems.push({ key: '/login-tasks', label: '登录任务', icon: }); + douyuItems.push({ key: '/login-tasks', label: '登录任务', icon: }); } - - // Cookie 管理 if (can('cookie:view')) { - menuItems.push({ key: '/cookies', label: 'Cookie 管理', icon: }); + douyuItems.push({ key: '/cookies', label: 'Cookie 管理', icon: }); } - // 虎牙 CK 管理 + // 虎牙 if (can('huya:account')) { - menuItems.push({ key: '/huya/accounts', label: '虎牙 CK', icon: }); + huyaItems.push({ key: '/huya/accounts', label: '账号管理', icon: }); } - - // 虎牙兑换与充值 if (can('huya:task')) { - menuItems.push({ key: '/huya/tasks', label: '虎牙任务', icon: }); + huyaItems.push({ key: '/huya/tasks', label: '任务操作台', icon: }); } - // 代理配置 + if (douyuItems.length > 0) { + menuItems.push({ key: 'group-douyu', type: 'group', label: '斗鱼', children: douyuItems }); + } + if (huyaItems.length > 0) { + menuItems.push({ key: 'group-huya', type: 'group', label: '虎牙', children: huyaItems }); + } + + // 系统 if (can('proxy:manage')) { - menuItems.push({ key: '/proxy', label: '代理配置', icon: }); + systemItems.push({ key: '/proxy', label: '代理配置', icon: }); } - - // 用户管理 if (can('user:view')) { - menuItems.push({ key: '/users', label: '用户管理', icon: }); + systemItems.push({ key: '/users', label: '用户管理', icon: }); + } + if (systemItems.length > 0) { + menuItems.push({ key: 'group-system', type: 'group', label: '系统', children: systemItems }); } const handleLogout = () => { @@ -129,7 +133,7 @@ export default function MainLayout({ onLogout }: { onLogout?: () => void }) { color: siderTextColor, }}> - {collapsed ? '鱼' : '斗鱼登录后台'} + {collapsed ? : '直播运营后台'}