|
@@ -124,7 +124,8 @@ public class EmailConfigServiceImpl implements EmailConfigService {
|
|
|
ResultVo vo = new ResultVo(ResultCode.CONNECT_SUCCESS);
|
|
|
MailboxInfoDTO mailboxInfoDTO = new MailboxInfoDTO();
|
|
|
mailboxInfoDTO.setAccount(mailboxInfoVO.getEmail());
|
|
|
- mailboxInfoDTO.setPassword(getPassword(mailboxInfoVO.getPassword()));
|
|
|
+ // mailboxInfoDTO.setPassword(getPassword(mailboxInfoVO.getPassword()));
|
|
|
+ mailboxInfoDTO.setPassword(mailboxInfoVO.getPassword());
|
|
|
mailboxInfoDTO.setPort(mailboxInfoVO.getPort());
|
|
|
mailboxInfoDTO.setHost(mailboxInfoVO.getServer());
|
|
|
mailboxInfoDTO.setProtocol(mailboxInfoVO.getProtocol());
|
|
@@ -251,7 +252,8 @@ public class EmailConfigServiceImpl implements EmailConfigService {
|
|
|
mailboxInfoDO.setServer(mailboxInfoVO.getServer());
|
|
|
mailboxInfoDO.setPort(mailboxInfoVO.getPort());
|
|
|
mailboxInfoDO.setDescription(mailboxInfoVO.getDescription());
|
|
|
- mailboxInfoDO.setPassword(mailboxInfoVO.getPassword());
|
|
|
+ // mailboxInfoDO.setPassword(mailboxInfoVO.getPassword());
|
|
|
+ mailboxInfoDO.setPassword(encryptPassword(mailboxInfoVO.getPassword()));
|
|
|
mailboxInfoDO.setType(mailboxInfoVO.getType());
|
|
|
mailboxInfoDO.setProtocol(mailboxInfoVO.getProtocol());
|
|
|
mailboxInfoDO.setOpenStatus(mailboxInfoVO.getOpenStatus());
|
|
@@ -261,5 +263,8 @@ public class EmailConfigServiceImpl implements EmailConfigService {
|
|
|
return mailboxInfoDO;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ private String encryptPassword (String password){
|
|
|
+ String publicKey = this.properties.getSecurityRsa().getPublicKey();
|
|
|
+ return new RSA(null, publicKey).encryptBase64(password, KeyType.PublicKey);
|
|
|
+ }
|
|
|
}
|