diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java index 43b2719dc8..cdb5517058 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java @@ -48,6 +48,10 @@ public class GovWebController { String newPassword = RSASignature.decryptByPrivateKey(formDTO.getPassword(), privateKey); formDTO.setPassword(newPassword); } + if (formDTO.getPhone().length() > 50) { + String phone = RSASignature.decryptByPrivateKey(formDTO.getPhone(), privateKey); + formDTO.setPhone(phone); + } } catch (Exception e) { log.error("method exception", e); diff --git a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java index cf4471f6c6..79efcf7054 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.RSASignature; @@ -98,7 +99,15 @@ public class LoginController { //效验数据 ValidatorUtils.validateEntity(formDTO); //解密密码 - if (formDTO.getPassword().length() > 50) { + if (formDTO.getPhone().length() > NumConstant.FIFTY) { + String phone = RSASignature.decryptByPrivateKey(formDTO.getPhone(), privateKey); + formDTO.setPhone(phone); + } + if (formDTO.getMobile().length() > NumConstant.FIFTY) { + String phone = RSASignature.decryptByPrivateKey(formDTO.getMobile(), privateKey); + formDTO.setMobile(phone); + } + if (formDTO.getPassword().length() > NumConstant.FIFTY) { String confirmNewPassWord = RSASignature.decryptByPrivateKey(formDTO.getPassword(), privateKey); formDTO.setPassword(confirmNewPassWord); }