一、首先先加入邮箱依赖,看下面链接!
二、大概思路及实现
1.数据库加一个验证字段
2.先让用户进行注册
前端实现:(正常的注册,只是邮箱必填,会的直接跳过看后台实现)
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>注册</title>
</head>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" th:href="@{/bodystyle.css}" />
<link rel="stylesheet" type="text/css" th:href="@{/loginStyle.css}" />
<title>注册界面</title>
</head>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<body><center>
<div >
<div class="uu">
<div class="dl">
<img width="150" height="80" th:alt="学法平台注册" th:src="@{/image/auncel.jpg}"/>
</div>
<form method="post" name="form1">
<table>
<tr>
<td align="center"></td></tr>
<tr><td><img th:alt="用户名" th:src="@{/image/user.PNG}" width="40" height="30"/></td><td><input type="text" name="name" value="请输入用户名" id="name"></td></tr>
<tr><td><img th:alt="用户密码" th:src="@{/image/password.PNG}" width="40" height="30" /></td><td