From db292f479cdb6d559e2f0cda2bbfc274337d33bd Mon Sep 17 00:00:00 2001 From: NanGua-QWQ Date: Thu, 12 Feb 2026 17:57:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=9B=AE=E5=89=8D=E6=B2=A1=E6=9C=89isDev?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=88=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/App.tsx | 55 ++++++++++++++----- .../src/components/TagEditorDialog.tsx | 12 ++-- 2 files changed, 48 insertions(+), 19 deletions(-) diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 0ba1f77..04ebe4d 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -139,22 +139,32 @@ function MainContent(): React.JSX.Element { /> - {/* 开发中画面水印 */} -

- 开发中画面,不代表真正品质 ({getArchitecture()}) + opacity: 0.6, + zIndex: 9999 + }}> +

+ 开发中画面,不代表最终品质

+

+ SecScore Dev ({getPlatform()}-{getArchitecture()}) +

+ ) } @@ -166,16 +176,31 @@ function getArchitecture(): string { if (userAgent.includes('arm64') || userAgent.includes('aarch64')) { return 'ARM64'; - } else if (userAgent.includes('x86_64') || userAgent.includes('amd64')) { - return 'x86_64'; + } else if (userAgent.includes('x64') || userAgent.includes('amd64')) { + return 'x64'; } else if (userAgent.includes('i386') || userAgent.includes('i686')) { return 'x86'; } // 默认返回未知架构 - return 'Unknown'; + return userAgent; } +function getPlatform(): string { + + // 尝试从 userAgent 中获取平台信息 + const userAgent = navigator.userAgent.toLowerCase(); + + if (userAgent.includes('windows')) { + return 'Windows'; + } else if (userAgent.includes('mac')) { + return 'Mac'; + } else if (userAgent.includes('linux')) { + return 'Linux'; + } + + return 'Unknown'; +} function App(): React.JSX.Element { return ( diff --git a/src/renderer/src/components/TagEditorDialog.tsx b/src/renderer/src/components/TagEditorDialog.tsx index ae7af62..2bf0a2d 100644 --- a/src/renderer/src/components/TagEditorDialog.tsx +++ b/src/renderer/src/components/TagEditorDialog.tsx @@ -1,5 +1,6 @@ import React, { useState, useEffect } from 'react' import { Dialog, Input, Button, Space, Tag, MessagePlugin } from 'tdesign-react' +import { useTheme } from '../contexts/ThemeContext' // 导入主题上下文 interface Tag { id: number @@ -25,6 +26,9 @@ export const TagEditorDialog: React.FC = ({ const [allTags, setAllTags] = useState([]) const [selectedTagIds, setSelectedTagIds] = useState>(new Set(initialTagIds)) const [loading, setLoading] = useState(false) + const { currentTheme } = useTheme() // 获取当前主题 + + const themeMode = currentTheme?.mode || 'light'; // 默认为 light useEffect(() => { if (visible) { @@ -54,8 +58,8 @@ export const TagEditorDialog: React.FC = ({ const trimmed = inputValue.trim() if (!trimmed) return - if (trimmed.length > 50) { - MessagePlugin.error('标签名称不能超过 50 个字符') + if (trimmed.length > 30) { + MessagePlugin.error('标签名称不能超过 30 个字符') return } @@ -175,7 +179,7 @@ export const TagEditorDialog: React.FC = ({ handleToggleTag(tag.id)} style={{ cursor: 'pointer' }} @@ -202,7 +206,7 @@ export const TagEditorDialog: React.FC = ({ handleDeleteTag(tag.id)} style={{ cursor: 'pointer' }}