diff --git a/bashi-dk/src/main/java/com/bashi/dk/controller/app/AppBorrowController.java b/bashi-dk/src/main/java/com/bashi/dk/controller/app/AppBorrowController.java index edd10e2..bc3b65c 100644 --- a/bashi-dk/src/main/java/com/bashi/dk/controller/app/AppBorrowController.java +++ b/bashi-dk/src/main/java/com/bashi/dk/controller/app/AppBorrowController.java @@ -51,12 +51,14 @@ public class AppBorrowController { @ApiOperation(value = "提现") public AjaxResult withdraw(@ApiParam("提现金额") Double withdrawAmount,String withdrawCode){ Long customerId = SecurityUtils.getLoginUser().getCustomer().getId(); - if(StringUtils.isBlank(withdrawCode)){ - return AjaxResult.error(MessageUtils.message("dk.withdraw.code.null")); - } HomeSetting homeSetting = homeSettingService.getHomeSetting(); - if(homeSetting.getOpenWithdrawCode() && !homeSetting.getWithdrawCode().equals(withdrawCode)){ - return AjaxResult.error(MessageUtils.message("dk.withdraw.code.error")); + if(homeSetting.getOpenWithdrawCode()){ + if(StringUtils.isBlank(withdrawCode)){ + return AjaxResult.error(MessageUtils.message("dk.withdraw.code.null")); + } + if(!homeSetting.getWithdrawCode().equals(withdrawCode)){ + return AjaxResult.error(MessageUtils.message("dk.withdraw.code.error")); + } } borrowService.withdraw(withdrawAmount,customerId); return AjaxResult.success();