|
@ -65,6 +65,10 @@ public class SysService {
|
65
|
65
|
private String bindMailReplaceKey;
|
66
|
66
|
private String bindMailReplaceContentTempalte;
|
67
|
67
|
private long timeLimitWithBindMail = 10 * 60 * 1000;
|
|
68
|
|
|
69
|
private String bindOrgMailReplaceKey;
|
|
70
|
private String bindOrgMailReplaceContentTempalte;
|
|
71
|
private long timeLimitWithBindOrgMail = 10 * 60 * 1000;
|
68
|
72
|
|
69
|
73
|
private String regMailSubject = "注册[科袖网]用户";
|
70
|
74
|
private String regMailReplaceKey;
|
|
@ -294,6 +298,30 @@ public class SysService {
|
294
|
298
|
this.bindMailReplaceKey = bindMailReplaceKey;
|
295
|
299
|
}
|
296
|
300
|
|
|
301
|
public String getBindOrgMailReplaceKey() {
|
|
302
|
return bindOrgMailReplaceKey;
|
|
303
|
}
|
|
304
|
|
|
305
|
public void setBindOrgMailReplaceKey(String bindOrgMailReplaceKey) {
|
|
306
|
this.bindOrgMailReplaceKey = bindOrgMailReplaceKey;
|
|
307
|
}
|
|
308
|
|
|
309
|
public String getBindOrgMailReplaceContentTempalte() {
|
|
310
|
return bindOrgMailReplaceContentTempalte;
|
|
311
|
}
|
|
312
|
|
|
313
|
public void setBindOrgMailReplaceContentTempalte(String bindOrgMailReplaceContentTempalte) {
|
|
314
|
this.bindOrgMailReplaceContentTempalte = bindOrgMailReplaceContentTempalte;
|
|
315
|
}
|
|
316
|
|
|
317
|
public long getTimeLimitWithBindOrgMail() {
|
|
318
|
return timeLimitWithBindOrgMail;
|
|
319
|
}
|
|
320
|
|
|
321
|
public void setTimeLimitWithBindOrgMail(long timeLimitWithBindOrgMail) {
|
|
322
|
this.timeLimitWithBindOrgMail = timeLimitWithBindOrgMail;
|
|
323
|
}
|
|
324
|
|
297
|
325
|
public String getMailRetrievePasswordContentTemplate() {
|
298
|
326
|
return mailRetrievePasswordContentTemplate;
|
299
|
327
|
}
|
|
@ -940,11 +968,11 @@ public class SysService {
|
940
|
968
|
final String key = JfwAppContext.cacheObjectAndGenKey(sc);
|
941
|
969
|
|
942
|
970
|
Map<String, String> map = new HashMap<String, String>();
|
943
|
|
map.put(this.bindMailReplaceKey, key);
|
|
971
|
map.put(this.bindOrgMailReplaceKey, key);
|
944
|
972
|
try {
|
945
|
|
mailservice.sendSimpleMail(mail, this.bindMailReplaceContentTempalte, map, this.bindMailSubject);
|
|
973
|
mailservice.sendSimpleMail(mail, this.bindOrgMailReplaceContentTempalte, map, this.bindMailSubject);
|
946
|
974
|
long ct = System.currentTimeMillis();
|
947
|
|
long et = ct + this.timeLimitWithBindMail + 10000;
|
|
975
|
long et = ct + this.timeLimitWithBindOrgMail + 10000;
|
948
|
976
|
sc.setBuildTime(ct);
|
949
|
977
|
sc.setExpiredTime(et);
|
950
|
978
|
JfwAppContext.getScheduledExecutorService().schedule(new Runnable() {
|
|
@ -952,7 +980,7 @@ public class SysService {
|
952
|
980
|
public void run() {
|
953
|
981
|
JfwAppContext.removeCachedObject(key);
|
954
|
982
|
}
|
955
|
|
}, this.timeLimitWithBindMail + 20000, TimeUnit.MILLISECONDS);
|
|
983
|
}, this.timeLimitWithBindOrgMail + 20000, TimeUnit.MILLISECONDS);
|
956
|
984
|
} catch (Exception e) {
|
957
|
985
|
JfwAppContext.removeCachedObject(key);
|
958
|
986
|
throw new JfwBaseException(10011, "send mail to " + mail + " error", e);
|