新版仿ok交易所-后端
1
zyy
2026-03-05 9fa09b7700040b6cf416081ba0edfcfb72219b16
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();
@@ -527,6 +529,7 @@
                }
            }
        }
        map.put("partyId", party.getUserId());
        map.put("username", party.getUserName());
        map.put("userrole", party.getRoleName());
        map.put("usercode", party.getUserCode());
@@ -542,7 +545,7 @@
        map.put("lastloginip", party.getUserLastip());
        map.put("creditScore", party.getCreditScore());
        // 实名认证通过返回真实姓名
        if (party.isRealNameAuthority()) {
        if (party.isRealNameAuthority() && kyc != null) {
            map.put("name", kyc.getName());
        }
        if (null != kyc) {
@@ -872,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/取消邮箱绑定;
     */