新版仿ok交易所-后端
zyy
2025-10-23 07ffe1dc04495e2584fb714ca52bf8801053d1d9
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiUserController.java
@@ -497,6 +497,7 @@
        map.put("advancedverif", party.isHighlevelAuthority());
        map.put("lastlogintime", party.getUserLasttime());
        map.put("lastloginip", party.getUserLastip());
        map.put("creditScore", party.getCreditScore());
        // 实名认证通过返回真实姓名
        if (party.isRealNameAuthority()) {
            map.put("name", kyc.getName());
@@ -763,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")