From df2dabfe76cfa4fd7e83aeb511b4c91ecbea953f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E7=91=BE?= Date: Thu, 11 Sep 2025 13:13:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=B0=86=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E4=B8=BA=E5=90=8E=E7=AB=AF=E5=A4=84=E7=90=86=20(#1247?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 将默认密码相关逻辑重构为后端处理 * refactor: 日志路由进行脱敏,生成随机密码使用node:crypto.randomBytes * feat: 更新密码功能增强,添加新密码强度验证和旧密码检查 * feat: 给文件管理添加WebUI配置文件的脱敏处理和验证逻辑 * refactor: 优化网络显示卡片按钮样式和行为,调整按钮属性以提升用户体验 * feat: 增强路径处理逻辑,添加安全验证以防止路径遍历攻击 * feat: 增强文件路径处理逻辑,添加安全验证以防止路径遍历攻击,并优化查询参数提取 * feat: CodeQL不认可 受不了 --- .vscode/settings.json | 7 +- .../components/display_card/common_card.tsx | 29 +- napcat.webui/src/controllers/webui_manager.ts | 15 - .../dashboard/config/change_password.tsx | 126 ++++---- napcat.webui/src/pages/index.tsx | 41 +-- napcat.webui/src/pages/web_login.tsx | 93 ++++-- src/onebot/index.ts | 103 +++--- src/webui/index.ts | 67 +++- src/webui/src/api/Auth.ts | 78 +++-- src/webui/src/api/File.ts | 306 ++++++++++++++++-- src/webui/src/api/Log.ts | 12 +- src/webui/src/helper/config.ts | 58 +++- src/webui/src/middleware/auth.ts | 11 +- src/webui/src/router/auth.ts | 3 - 14 files changed, 650 insertions(+), 299 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 48eac328..de49d5e8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,4 +9,9 @@ "css.customData": [ ".vscode/tailwindcss.json" ], -} \ No newline at end of file + "editor.formatOnPaste": false, + "editor.formatOnSave": false, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "never" + }, +} diff --git a/napcat.webui/src/components/display_card/common_card.tsx b/napcat.webui/src/components/display_card/common_card.tsx index caf8a361..74e29720 100644 --- a/napcat.webui/src/components/display_card/common_card.tsx +++ b/napcat.webui/src/components/display_card/common_card.tsx @@ -62,24 +62,39 @@ const NetworkDisplayCard = ({ -