新版仿ok交易所-后端
zyy
2026-03-02 13d2b292d2bb60e857de7587cb5a3a40c9f48858
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/取消邮箱绑定;
     */