From 0632b21db7576e4a223eb4f6ca09b650616222f2 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期三, 17 一月 2024 09:54:09 +0800 Subject: [PATCH] Fixed: 移除 lodash, @type/lodash 導致的 side-effect --- pamapi/src/main/java/com/pollex/pam/service/CustomerService.java | 27 +++++++++++++++++---------- 1 files changed, 17 insertions(+), 10 deletions(-) diff --git a/pamapi/src/main/java/com/pollex/pam/service/CustomerService.java b/pamapi/src/main/java/com/pollex/pam/service/CustomerService.java index 98af88a..77f2f75 100644 --- a/pamapi/src/main/java/com/pollex/pam/service/CustomerService.java +++ b/pamapi/src/main/java/com/pollex/pam/service/CustomerService.java @@ -60,16 +60,23 @@ String account = getCustomerAccount(registDTO); OtpTmp otpTmp = otpTmpService.findByAccountAndIndexKey(account, registDTO.getIndexKey()); - if(otpTmp.getStatus() == OtpTmpStatusEnum.VERRIFIED) { - Customer customer = customerDTOMapper.toCustomer(registDTO); - customer.setDataFrom(DataFromEnum.PAM); - save(customer); - return customer; - }else { - throw new IllegalArgumentException("Invalid indexKey state error. IndexKey: " - + registDTO.getIndexKey() - + " => status: " + otpTmp.getStatus()); - } + + if(otpTmp!=null) { + if(otpTmp.getStatus() == OtpTmpStatusEnum.VERRIFIED) { + Customer customer = customerDTOMapper.toCustomer(registDTO); + customer.setDataFrom(DataFromEnum.PAM); + save(customer); + return customer; + }else { + throw new IllegalArgumentException("Invalid indexKey state error. IndexKey: " + + registDTO.getIndexKey() + + " => status: " + otpTmp.getStatus()); + } + }else { + throw new IllegalArgumentException("otp tmp not exist"); + } + + } } -- Gitblit v1.8.0