1
zj
2 days ago f658569891db433854221b80f0a9fa99608cff64
trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiExchangeLeverApplyOrderController.java
@@ -198,6 +198,7 @@
        if (!party.isEnabled()) {
            throw new YamiShopBindException("用户已禁用");
        }
        validateTradePermission(party);
        ExchangeLeverApplyOrder order = new ExchangeLeverApplyOrder();
        order.setPartyId(SecurityUtils.getCurrentUserId());
        order.setSymbol(symbol);
@@ -413,6 +414,7 @@
            if (!party.isEnabled()) {
                throw new BusinessException("用户已锁定");
            }
            validateTradePermission(party);
//         if (!party.getKyc_authority()) {
//            resultObject.setCode("401");
//            resultObject.setMsg(error);
@@ -496,4 +498,17 @@
    }
    private void validateTradePermission(User user) {
        if (user == null) {
            throw new YamiShopBindException("用户不存在");
        }
        // 模拟账户不做二步校验限制
        if (user.getAccountType() != null && user.getAccountType() == 1) {
            return;
        }
        if (!user.isGoogleAuthBind() || StringUtils.isEmptyString(user.getSafePassword())) {
            throw new YamiShopBindException("请先完成两步认证并设置资金密码后再交易");
        }
    }
}