From f006464116a751c2d6507f3ca00f216fb42351e7 Mon Sep 17 00:00:00 2001 From: "Logan.Li" Date: Tue, 27 Oct 2026 17:39:32 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=A4=96=E8=A7=82=E5=8C=BA=E7=B2=BE=E7=AE=80=E2=80=94?= =?UTF-8?q?=E2=80=94=E7=A7=BB=E9=99=A4=E4=B8=BB=E9=A2=98=E8=89=B2/?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E5=A4=A7=E5=B0=8F/=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=AF=86=E5=BA=A6/=E5=9C=86=E8=A7=92=E9=A3=8E=E6=A0=BC?= =?UTF-8?q?=EF=BC=8C=E4=BB=85=E4=BF=9D=E7=95=99=E4=B8=BB=E9=A2=98=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=EF=BC=9B=E4=BF=AE=E5=A4=8D=20/login=20=E4=B8=8E?= =?UTF-8?q?=E6=9C=AA=E7=9F=A5=E8=B7=AF=E5=BE=84=E9=87=8D=E5=AE=9A=E5=90=91?= =?UTF-8?q?=E6=AD=BB=E5=BE=AA=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 2 + frontend/src/pages/SystemSettings.tsx | 103 +------------------------- 2 files changed, 3 insertions(+), 102 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index aee58a5..20c552c 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -114,6 +114,8 @@ export default function App() { // URL → 页面状态(直接输入/刷新/分享链接时恢复) useEffect(() => { const path = location.pathname.replace(/\/+$/, '') || '/'; + // 登录页不参与模块路由(否则与未登录跳转互相重定向形成死循环) + if (path === '/login') return; const editorMatch = path.match(/^\/pipelines\/(\d+)/); if (editorMatch) { setActiveModule('pipelines'); diff --git a/frontend/src/pages/SystemSettings.tsx b/frontend/src/pages/SystemSettings.tsx index d35af11..800610f 100644 --- a/frontend/src/pages/SystemSettings.tsx +++ b/frontend/src/pages/SystemSettings.tsx @@ -1,7 +1,7 @@ import { useEffect, useRef, useState } from 'react'; import { Palette, Monitor, Moon, Sun, - Save, RotateCcw, CheckCircle2, Globe, Bell, Loader2, ExternalLink, ChevronDown, ChevronRight + Save, RotateCcw, Globe, Bell, Loader2, ExternalLink, ChevronDown, ChevronRight } from 'lucide-react'; import { toast } from 'sonner'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; @@ -11,11 +11,6 @@ import WebhookManager from '@/components/settings/WebhookManager'; interface ThemeConfig { mode: 'light' | 'dark' | 'system'; - primaryColor: string; - fontSize: 'small' | 'medium' | 'large'; - density: 'compact' | 'comfortable' | 'spacious'; - sidebarStyle: 'collapsed' | 'icons' | 'full'; - borderRadius: 'sharp' | 'soft' | 'round'; } interface NotificationConfig { @@ -28,11 +23,6 @@ interface NotificationConfig { const defaultTheme: ThemeConfig = { mode: 'light', - primaryColor: '#0969da', - fontSize: 'medium', - density: 'comfortable', - sidebarStyle: 'full', - borderRadius: 'soft', }; const defaultNotifications: NotificationConfig = { @@ -55,15 +45,6 @@ function safeParse(raw: unknown, fallback: T): T { } } -const colorOptions = [ - { name: '蓝色', value: '#0969da', class: 'bg-[#0969da]' }, - { name: '绿色', value: '#1a7f37', class: 'bg-[#1a7f37]' }, - { name: '紫色', value: '#8250df', class: 'bg-[#8250df]' }, - { name: '橙色', value: '#bc4c00', class: 'bg-[#bc4c00]' }, - { name: '红色', value: '#cf222e', class: 'bg-[#cf222e]' }, - { name: '青色', value: '#0e7c7b', class: 'bg-[#0e7c7b]' }, -]; - // LLM 服务商预设(OpenAI 兼容接口) const LLM_PROVIDERS = [ { id: 'deepseek', label: 'DeepSeek', endpoint: 'https://api.deepseek.com/v1', model: 'deepseek-chat', keyUrl: 'https://platform.deepseek.com/api_keys' }, @@ -365,88 +346,6 @@ export default function SystemSettings() { ))} - - {/* Primary color */} -
- -
- {colorOptions.map(c => ( - - ))} -
-
- - {/* Font size */} -
- -
- {[ - { id: 'small', label: '小', size: '12px' }, - { id: 'medium', label: '中', size: '14px' }, - { id: 'large', label: '大', size: '16px' }, - ].map(f => ( - - ))} -
-
- - {/* Density */} -
- -
- {[ - { id: 'compact', label: '紧凑' }, - { id: 'comfortable', label: '舒适' }, - { id: 'spacious', label: '宽松' }, - ].map(d => ( - - ))} -
-
- - {/* Border radius */} -
- -
- {[ - { id: 'sharp', label: '直角', radius: '0px' }, - { id: 'soft', label: '圆角', radius: '6px' }, - { id: 'round', label: '大圆角', radius: '12px' }, - ].map(r => ( - - ))} -
-