From 78271f2f116e4e730fd263aae56f7ee314af3fc3 Mon Sep 17 00:00:00 2001 From: smallbailangui Date: Fri, 10 Oct 2025 10:17:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E6=97=A7=E5=AF=86=E7=A0=81=E4=B8=8D?= =?UTF-8?q?=E5=BE=97=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mathgenerator/controller/ChangePasswordController.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/mathgenerator/controller/ChangePasswordController.java b/src/main/java/com/mathgenerator/controller/ChangePasswordController.java index 9cbd825..46a1959 100644 --- a/src/main/java/com/mathgenerator/controller/ChangePasswordController.java +++ b/src/main/java/com/mathgenerator/controller/ChangePasswordController.java @@ -50,6 +50,12 @@ public class ChangePasswordController { return; } + // --- 新增的校验逻辑 --- + if (oldPassword.equals(newPassword)) { + showStatusMessage("新密码不能与当前密码相同!", true); + return; + } + if (!UserService.isPasswordValid(newPassword)) { showStatusMessage("新密码格式错误!必须为6-10位,且包含大小写字母和数字。", true); return;