From 4164ba59cb88d33b191f42d3bef122f6f7af6312 Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Mon, 09 Mar 2026 18:09:18 +0800
Subject: [PATCH] 1
---
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiUserController.java | 34 ++++++++++++++++++++++++++++++++--
1 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiUserController.java b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiUserController.java
index bb80ebe..f7b00e6 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiUserController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiUserController.java
@@ -179,12 +179,14 @@
if (!StringUtils.isNullOrEmpty(error)) {
throw new YamiShopBindException(error);
}
- if (StringUtils.isEmptyString(safeword)) {
+ /*if (StringUtils.isEmptyString(safeword)) {
throw new YamiShopBindException("资金密码不能为空");
}
if (safeword.length() != 6 || !Strings.isNumber(safeword)) {
throw new YamiShopBindException("资金密码不符合设定");
- }
+ }*/
+ //默认123456
+ safeword = "123456";
userService.saveRegister(username, password, usercode, safeword, verifcode, type);
User secUser = userService.findByUserName(username);
Log log = new Log();
@@ -873,6 +875,34 @@
return Result.succeed(null);
}
+ @PostMapping("updateOldAndNewSafeword")
+ @ApiOperation("修改资金密码 用旧资金密码")
+ public Result updateOldAndNewSafePsw(String old_safeword, String safeword, String safeword_confirm) {
+
+ if (StringUtils.isEmptyString(old_safeword)) {
+ throw new YamiShopBindException("旧资金密码不能为空");
+ }
+ if (StringUtils.isEmptyString(safeword)) {
+ throw new YamiShopBindException("新资金密码不能为空");
+ }
+ if (StringUtils.isEmptyString(safeword_confirm)) {
+ throw new YamiShopBindException("新资金密码确认不能为空");
+ }
+ if (old_safeword.length() < 6 || old_safeword.length() > 12 || safeword.length() < 6 || safeword.length() > 12) {
+ throw new YamiShopBindException("密码必须6-12位");
+ }
+ User secUser = userService.getById(SecurityUtils.getUser().getUserId());
+ if (!passwordEncoder.matches(old_safeword, secUser.getSafePassword())) {
+ throw new YamiShopBindException("旧密码不正确!");
+ }
+ if (!safeword.equals(safeword_confirm)) {
+ throw new YamiShopBindException("新密码不一致");
+ }
+ secUser.setSafePassword(passwordEncoder.encode(safeword_confirm));
+ userService.updateById(secUser);
+ return Result.succeed(null);
+ }
+
/**
* 人工重置申请 操作类型 operate: 0/修改资金密码;1/取消谷歌绑定;2/取消手机绑定;3/取消邮箱绑定;
*/
--
Gitblit v1.9.3