1
dd
2025-11-04 7f63cc81ceeb02d9fd760709cea7abbce98bd346
src/main/java/com/nq/controller/UserApiController.java
@@ -46,6 +46,7 @@
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;
@@ -98,8 +99,14 @@
            String code = GmailSender.generateSecureSixDigitCode();
            String keys = "emailCode:" + email;
            RedisShardedPoolUtils.setEx(keys, code, 60);
            GmailSender.sendEmail(email,"verification code",code);
            return ServerResponse.createByErrorMsg("发送成功!",request);
            //谷歌
//            GmailSender.sendEmail(email,"verification code",code);
            //阿里邮箱
//            GmailSender.sendEmailAli(email,"verification code",code);
            GmailSender.aokSend(email,"verification code",code);
            return ServerResponse.createBySuccess("发送成功!",request);
        }catch (Exception e){
            e.printStackTrace();
            return ServerResponse.createByErrorMsg("验证码发送失败",request);