|
@ -1,6 +1,7 @@ |
|
|
package com.epmet.controller; |
|
|
package com.epmet.controller; |
|
|
|
|
|
|
|
|
import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO; |
|
|
import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO; |
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.utils.RSASignature; |
|
|
import com.epmet.commons.tools.utils.RSASignature; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
@ -9,6 +10,7 @@ import com.epmet.dto.form.GovWebLoginFormDTO; |
|
|
import com.epmet.dto.result.UserTokenResultDTO; |
|
|
import com.epmet.dto.result.UserTokenResultDTO; |
|
|
import com.epmet.service.GovWebService; |
|
|
import com.epmet.service.GovWebService; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
@ -44,11 +46,11 @@ public class GovWebController { |
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
if (formDTO.getPassword().length() > 50) { |
|
|
if (StringUtils.isNotBlank(formDTO.getPassword())&&formDTO.getPassword().length() > NumConstant.FIFTY) { |
|
|
String newPassword = RSASignature.decryptByPrivateKey(formDTO.getPassword(), privateKey); |
|
|
String newPassword = RSASignature.decryptByPrivateKey(formDTO.getPassword(), privateKey); |
|
|
formDTO.setPassword(newPassword); |
|
|
formDTO.setPassword(newPassword); |
|
|
} |
|
|
} |
|
|
if (formDTO.getPhone().length() > 50) { |
|
|
if (StringUtils.isNotBlank(formDTO.getPhone())&&formDTO.getPhone().length() > NumConstant.FIFTY) { |
|
|
String phone = RSASignature.decryptByPrivateKey(formDTO.getPhone(), privateKey); |
|
|
String phone = RSASignature.decryptByPrivateKey(formDTO.getPhone(), privateKey); |
|
|
formDTO.setPhone(phone); |
|
|
formDTO.setPhone(phone); |
|
|
} |
|
|
} |
|
|