| | |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import org.springframework.mail.javamail.JavaMailSender; |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | String code = GmailSender.generateSecureSixDigitCode(); |
| | | String keys = "emailCode:" + email; |
| | | RedisShardedPoolUtils.setEx(keys, code, 60); |
| | | GmailSender.sendEmail(email,"verification code",code); |
| | | //谷歌 |
| | | // GmailSender.sendEmail(email,"verification code",code); |
| | | //阿里邮箱 |
| | | GmailSender.sendEmailAli(email,"verification code",code); |
| | | return ServerResponse.createBySuccess("发送成功!",request); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |