删除测试库
删除 wecome 增加新代码
This commit is contained in:
@@ -20,6 +20,8 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -72,9 +74,10 @@ public class PasswordRecoveryService implements Reloadable, HasCleanup {
|
||||
if (!checkEmailCooldown(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'年'MM'月'dd'日' HH:mm:ss");
|
||||
Date date = new Date(System.currentTimeMillis());
|
||||
String recoveryCode = recoveryCodeService.generateCode(player.getName());
|
||||
boolean couldSendMail = emailService.sendRecoveryCode(player.getName(), email, recoveryCode);
|
||||
boolean couldSendMail = emailService.sendRecoveryCode(player.getName(), email, recoveryCode, dateFormat.format(date));
|
||||
if (couldSendMail) {
|
||||
commonService.send(player, MessageKey.RECOVERY_CODE_SENT);
|
||||
emailCooldown.add(player.getName().toLowerCase(Locale.ROOT));
|
||||
@@ -94,6 +97,8 @@ public class PasswordRecoveryService implements Reloadable, HasCleanup {
|
||||
if (!checkEmailCooldown(player)) {
|
||||
return;
|
||||
}
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'年'MM'月'dd'日' HH:mm:ss");
|
||||
Date date = new Date(System.currentTimeMillis());
|
||||
|
||||
String name = player.getName();
|
||||
String thePass = RandomStringUtils.generate(commonService.getProperty(RECOVERY_PASSWORD_LENGTH));
|
||||
@@ -102,7 +107,7 @@ public class PasswordRecoveryService implements Reloadable, HasCleanup {
|
||||
logger.info("Generating new password for '" + name + "'");
|
||||
|
||||
dataSource.updatePassword(name, hashNew);
|
||||
boolean couldSendMail = emailService.sendPasswordMail(name, email, thePass);
|
||||
boolean couldSendMail = emailService.sendPasswordMail(name, email, thePass, dateFormat.format(date));
|
||||
if (couldSendMail) {
|
||||
commonService.send(player, MessageKey.RECOVERY_EMAIL_SENT_MESSAGE);
|
||||
emailCooldown.add(player.getName().toLowerCase(Locale.ROOT));
|
||||
|
||||
Reference in New Issue
Block a user