邮箱、短信验证


下发邮箱验证,可以用于激活账户,找回密码,或者是绑定等操作;短信验证可用于登录,找回密码,绑定等操作,方法实现简单易懂
资源截图
代码片段和文件信息
package controller;

import com.fasterxml.jackson.databind.objectMapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.MailService;

import javax.annotation.Resource;
import java.util.HashMap;

/**
 * create by 1311230692@qq.com on 2018/10/10 13:08
 * 邮件发送控制层实现
 **/
@Controller
@RequestMapping(“/mail“)
public class MailController {

    @Resource(name=“MailService“)
    private MailService mailService;

    /**
     * 发送 HTML 账户激活邮件
     * */
    @RequestMapping(“/send“)
    @ResponseBody
    public String send(String email) throws Exception{
        HashMap map = new HashMap<>();
        objectMapper objectMapper = new objectMapper();

        mailService.sendHtmlMail(email);
        map.put(“result“ “success“);

        return objectMapper.writeValueAsString(map);
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-10-10 15:04  checkcode
     目录           0  2018-10-10 15:07  checkcode.git
     目录           0  2018-10-10 15:04  checkcode.gitranches
     文件          34  2018-10-10 15:05  checkcode.gitCOMMIT_EDITMSG
     文件         306  2018-10-10 15:07  checkcode.gitconfig
     文件          73  2018-10-10 15:04  checkcode.gitdescription
     文件          23  2018-10-10 15:04  checkcode.gitHEAD
     目录           0  2018-10-10 15:04  checkcode.githooks
     文件         478  2018-10-10 15:04  checkcode.githooksapplypatch-msg.sample
     文件         896  2018-10-10 15:04  checkcode.githookscommit-msg.sample
     文件        3327  2018-10-10 15:04  checkcode.githooksfsmonitor-watchman.sample
     文件         189  2018-10-10 15:04  checkcode.githookspost-update.sample
     文件         424  2018-10-10 15:04  checkcode.githookspre-applypatch.sample
     文件        1638  2018-10-10 15:04  checkcode.githookspre-commit.sample
     文件        1348  2018-10-10 15:04  checkcode.githookspre-push.sample
     文件        4898  2018-10-10 15:04  checkcode.githookspre-rebase.sample
     文件         544  2018-10-10 15:04  checkcode.githookspre-receive.sample
     文件        1492  2018-10-10 15:04  checkcode.githooksprepare-commit-msg.sample
     文件        3610  2018-10-10 15:04  checkcode.githooksupdate.sample
     文件        2956  2018-10-10 15:05  checkcode.gitindex
     目录           0  2018-10-10 15:04  checkcode.gitinfo
     文件         250  2018-10-10 15:04  checkcode.gitinfoexclude
     目录           0  2018-10-10 15:05  checkcode.gitlogs
     文件         182  2018-10-10 15:05  checkcode.gitlogsHEAD
     目录           0  2018-10-10 15:07  checkcode.gitlogs
efs
     目录           0  2018-10-10 15:05  checkcode.gitlogs
efsheads
     文件         182  2018-10-10 15:05  checkcode.gitlogs
efsheadsmaster
     目录           0  2018-10-10 15:07  checkcode.gitlogs
efs
emotes
     目录           0  2018-10-10 15:07  checkcode.gitlogs
efs
emotesorigin
     文件         145  2018-10-10 15:07  checkcode.gitlogs
efs
emotesoriginmaster
     目录           0  2018-10-10 15:05  checkcode.gitobjects
............此处省略198个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)