From f0ce531a447156c6853e37c1d7206ae25faf6c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Thu, 26 Mar 2026 08:59:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(shopping):=20=E4=BF=AE=E5=A4=8D=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E5=AF=86=E7=A0=81=E5=AD=98=E5=82=A8=E5=92=8C=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了 Redis 键中多余的冒号后缀 - 在密码验证失败时返回编码后的默认密码 - 确保所有密码操作都经过编码处理 --- .../quotation/controller/app/ShoppingController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java index 395793c0..84a0caa5 100644 --- a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java @@ -869,7 +869,7 @@ public class ShoppingController extends ControllerBase { */ @PostMapping("/setPassword") public ApiResult setPassword(@RequestBody String password) { - stringRedisTemplate.opsForHash().put("quotation:password:", String.valueOf(AppUserUtil.getUserId()), PASSWORDENCODER.encode(password)); + stringRedisTemplate.opsForHash().put("quotation:password", String.valueOf(AppUserUtil.getUserId()), PASSWORDENCODER.encode(password)); return ApiResult.success(); } @@ -878,10 +878,10 @@ public class ShoppingController extends ControllerBase { */ @PostMapping("/validatePassword") public ApiResult validatePassword(@RequestBody String password) { - Object pwd = stringRedisTemplate.opsForHash().get("quotation:password:", String.valueOf(AppUserUtil.getUserId())); + Object pwd = stringRedisTemplate.opsForHash().get("quotation:password", String.valueOf(AppUserUtil.getUserId())); // VUtils.trueThrowBusinessError(Objects.isNull(pwd)).throwMessage("还未设置过查看密码"); if (Objects.isNull(pwd)) { - pwd = "000000"; + pwd = PASSWORDENCODER.encode("000000"); } if (!PASSWORDENCODER.matches(password, pwd.toString())) { return ApiResult.error("查看密码不正确");