add 邮件密码 sysconfig表

master
luoyang 5 years ago
parent 2c7b8d4337
commit e99da7b7f2

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.2.42</version>
<version>1.2.43</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -65,6 +65,12 @@ public class MailServiceImp implements MailService {
private ClientManager clientManager;
@Value("${app.settle.aes-key}")
private String settleAESKey;
@Value("${app.partner.aes-key}")
private String partnerAESKey;
@Value("${app.risk.aes-key}")
private String riskAESKey;
@Value("${app.risk.control.aes-key}")
private String riskControlAESKey;
/* @Override
public void sendEmail(NoticeBean noticeBean) {
@ -126,8 +132,13 @@ public class MailServiceImp implements MailService {
if (files.size() > 0) {
noticeBean.setFiles(files.toString());
}
noticeBean.setSenderAddress("info@royalpay.com.au");
noticeBean.setPassword("Rpay2019");
JSONObject sysConfig = sysConfigManager.getSysConfig();
noticeBean.setSenderAddress(sysConfig.getString("partner.email.address"));
String mailPwdEncrypted = sysConfig.getString("partner.email.password");
Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured");
Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey));
String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8);
noticeBean.setPassword(mailPwd);
String postUrl = mailHost + "/mail?" + generateMailSignParam();
@ -163,8 +174,13 @@ public class MailServiceImp implements MailService {
mailClients.add(mailClient);
noticeBean.setMailClients(mailClients);
noticeBean.setContent(content);
noticeBean.setSenderAddress("info@royalpay.com.au");
noticeBean.setPassword("Rpay2019");
JSONObject sysConfig = sysConfigManager.getSysConfig();
noticeBean.setSenderAddress(sysConfig.getString("partner.email.address"));
String mailPwdEncrypted = sysConfig.getString("partner.email.password");
Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured");
Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey));
String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8);
noticeBean.setPassword(mailPwd);
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
HttpRequestResult result = null;
try {
@ -194,8 +210,13 @@ public class MailServiceImp implements MailService {
mailClients.add(mailClient);
noticeBean.setMailClients(mailClients);
noticeBean.setContent(content);
noticeBean.setSenderAddress("info@royalpay.com.au");
noticeBean.setPassword("Rpay2019");
JSONObject sysConfig = sysConfigManager.getSysConfig();
noticeBean.setSenderAddress(sysConfig.getString("partner.email.address"));
String mailPwdEncrypted = sysConfig.getString("partner.email.password");
Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured");
Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey));
String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8);
noticeBean.setPassword(mailPwd);
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
HttpRequestResult result = null;
try {
@ -312,11 +333,20 @@ public class MailServiceImp implements MailService {
noticeBean.setMailClients(mailClients);
noticeBean.setContent(content);
noticeBean.setAttachFiles(attachFiles);
noticeBean.setSenderAddress("riskcontrol@royalpay.com.au");
noticeBean.setPassword("Toc10755");
JSONObject sysConfig = sysConfigManager.getSysConfig();
noticeBean.setSenderAddress(sysConfig.getString("riskControl.email.address"));
String riskControlMailPwdEncrypted = sysConfig.getString("riskControl.email.password");
Assert.isTrue(StringUtils.isNotEmpty(riskControlMailPwdEncrypted), "riskControl mail pwd not configured");
Key riskControlAesKey = AESCrypt.fromKeyString(Base64.decodeBase64(riskControlAESKey));
String riskControlMailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(riskControlMailPwdEncrypted), riskControlAesKey), StandardCharsets.UTF_8);
noticeBean.setPassword(riskControlMailPwd);
if(order_type == 1 || order_type == 2){
noticeBean.setSenderAddress("risk@royalpay.com.au");
noticeBean.setPassword("Ruc38977");
String riskMailPwdEncrypted = sysConfig.getString("risk.email.password");
Assert.isTrue(StringUtils.isNotEmpty(riskMailPwdEncrypted), "risk mail pwd not configured");
Key riskAesKey = AESCrypt.fromKeyString(Base64.decodeBase64(riskAESKey));
String riskMailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(riskMailPwdEncrypted), riskAesKey), StandardCharsets.UTF_8);
noticeBean.setSenderAddress(sysConfig.getString("risk.email.address"));
noticeBean.setPassword(riskMailPwd);
}
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
HttpRequestResult result = null;

@ -113,6 +113,10 @@ im.openim.appkey=24986533
im.openim.secret=96e28e7be21a874177211c31834b5174
app.settle.aes-key=EPrfsM2JE69ZPR7BhXn34g==
app.partner.aes-key=xyc7Ya6TmL8/csM1ygtviA==
app.risk.aes-key=NRvwd9dgbT2Cdz6zJz9AWA==
app.risk.control.aes-key=Aa+MtthC4Ztq4Kfa9aL+UA==
#清算银行配置
settle.abafile.default-bank=CBA
settle.abafile.remains-to=ANZ

Loading…
Cancel
Save