From f4b6b26b1ec37a534fcfc85dda943536d236ebd8 Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Thu, 23 Oct 2025 17:24:21 +0800
Subject: [PATCH] 邮箱手机绑定

---
 trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiUserController.java |   39 +++++++++++++++++++++++++++++++++++----
 1 files changed, 35 insertions(+), 4 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 22d3a3b..4e04f18 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
@@ -572,7 +572,7 @@
         if (null != partyPhone && !partyPhone.getUserId().toString().equals(loginPartyId)) {
             throw new YamiShopBindException("电话号码已绑定其他用户");
         }
-        String authcode = identifyingCodeTimeWindowService.getAuthCode(phone);
+        /*String authcode = identifyingCodeTimeWindowService.getAuthCode(phone);
         String bind_phone_email_ver = this.sysparaService.find("bind_phone_email_ver").getSvalue();
         String bind_usercode = this.sysparaService.find("bind_usercode").getSvalue();
         // 如果是演示用户,则不判断验证码
@@ -603,7 +603,7 @@
 //						this.userRecomService.update(party.getId(), party_reco.getId());
                 }
             }
-        }
+        }*/
         // 电话绑定成功
         party.setUserMobile(phone);
         party.setUserMobileBind(true);
@@ -637,7 +637,7 @@
         if (null != partyEmail && !partyEmail.getUserId().toString().equals(loginPartyId)) {
             throw new YamiShopBindException("邮箱已绑定其他用户");
         }
-        String authcode = this.identifyingCodeTimeWindowService.getAuthCode(email);
+        /*String authcode = this.identifyingCodeTimeWindowService.getAuthCode(email);
         String bind_phone_email_ver = sysparaService.find("bind_phone_email_ver").getSvalue();
         // 如果是演示用户,则不判断验证码
         if (!"GUEST".contentEquals(party.getRoleName())) {
@@ -649,7 +649,7 @@
                     throw new YamiShopBindException("验证码不正确");
                 }
             }
-        }
+        }*/
         // 邮箱绑定成功
         party.setUserMail(email);
         party.setMailBind(true);
@@ -764,6 +764,37 @@
     }
 
     /**
+     *
+     */
+    @PostMapping("updateOldAndNewSafeword")
+    @ApiOperation("修改资金密码 用旧资金密码")
+    public Result updateOldAndNewSafeword(String old_safeword, String safeword, String re_safeword) {
+
+        if (StringUtils.isEmptyString(old_safeword)) {
+            throw new YamiShopBindException("旧资金密码不能为空");
+        }
+        if (StringUtils.isEmptyString(safeword)) {
+            throw new YamiShopBindException("新资金密码不能为空");
+        }
+        if (safeword.length() != 6 || !Strings.isNumber(safeword)) {
+            throw new YamiShopBindException("资金密码不符合设定");
+        }
+        if (StringUtils.isEmptyString(re_safeword)) {
+            throw new YamiShopBindException("新资金密码确认不能为空");
+        }
+        User secUser = userService.getById(SecurityUtils.getUser().getUserId());
+        if (!passwordEncoder.matches(old_safeword, secUser.getSafePassword())) {
+            throw new YamiShopBindException("旧密码不正确!");
+        }
+        if (!safeword.equals(re_safeword)) {
+            throw new YamiShopBindException("新密码不一致");
+        }
+        secUser.setSafePassword(passwordEncoder.encode(re_safeword));
+        userService.updateById(secUser);
+        return Result.succeed(null);
+    }
+
+    /**
      * 修改资金密码 用验证码
      */
     @PostMapping("setSafeword")

--
Gitblit v1.9.3