parent
e9ab99c12a
commit
501330a1f6
@ -0,0 +1,16 @@
|
||||
package com.tamguo.web;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Controller
|
||||
public class AccountController {
|
||||
|
||||
@RequestMapping(value = {"account.html"}, method = RequestMethod.GET)
|
||||
public ModelAndView list(ModelAndView model) {
|
||||
model.setViewName("account");
|
||||
return model;
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.tamguo.web;
|
||||
|
||||
import org.apache.commons.mail.EmailException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.tamguo.common.utils.Result;
|
||||
import com.tamguo.common.utils.SystemConstant;
|
||||
import com.tamguo.modules.sys.service.IEmailService;
|
||||
|
||||
@Controller
|
||||
public class EmailController {
|
||||
|
||||
@Autowired
|
||||
private IEmailService iEmailService;
|
||||
|
||||
@RequestMapping(value = {"sendFindPasswordEmail"}, method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Result sendFindPasswordEmail(String email){
|
||||
try {
|
||||
Integer result = iEmailService.sendFindPasswordEmail(email , SystemConstant.ALIYUN_MAIL_SUBJECT_FINDPASSWORD);
|
||||
if(result == 0){
|
||||
return Result.result(200, null, "服务器异常");
|
||||
}
|
||||
} catch (EmailException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return Result.result(500, null, "服务器异常");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
@charset "utf-8";
|
||||
body { font-family: "Microsoft Yahei"; color: #333;background:#f5f5f6}
|
||||
em, i { font-style: normal; }
|
||||
.start{color: red}
|
||||
.hide-text{ overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||
.well{height: 10px;background: #f5f5f6;width: 340px;position: relative;left: -10px;}
|
||||
.cnav { height: 98px; width: 100%; background: url(../../images/project-cnavbj.jpg) no-repeat; background-size: cover; }
|
||||
.cnav_b { position: relative; }
|
||||
.cnav_left { float: left; width: 162px; height: 54px; margin: 22px 0 0 46px; font-size: 18px; color: #fff; line-height: 54px; background: url(../../images/test-paper/top-kaos.png) no-repeat; padding-left: 55px; }
|
||||
.cnav_right { float: left; width:728px; height: 5px; background: url(../../images/project-cnav.png) repeat-x; margin: 47px 0 0 0; }
|
||||
.cnav_right ul { position: absolute; top: 30px; left: 230px; }
|
||||
.cnav_right ul li { width: 120px; height: 50px; float: left; font-size: 14px; color: #fff; text-align: center; line-height: 12px; margin-left: 32px; }
|
||||
.cnav_right ul li span { font-size: 12px; font-weight: bold; width: 27px; height: 27px; color: #29bdb9; display: block; margin: 5px auto 5px auto; text-align: center; line-height: 27px; background: url(../../images/project-candidate.png) no-repeat -26px 0; }
|
||||
.cnavX { background: url(../../images/project-candidate.png) no-repeat -61px -39px; width: 17px; height: 17px; position: absolute; top: 12px; left: 1082px; cursor: pointer; }
|
||||
.cnav_right ul li .Cnav_t { background: url(../../images/project-candidate.png) no-repeat -54px 0; width: 37px; height: 37px; line-height: 37px; margin: 0 auto; }
|
||||
.contentBox{margin-top: 20px;font-size: 14px;overflow: hidden;}
|
||||
.acphoto {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
/*padding: 0 2em;*/
|
||||
border: none;
|
||||
border-radius: 80px;
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
background: #eee;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
line-height: 28px;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
}
|
||||
.up_photo{
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
padding: 0 2em;
|
||||
/*border: none;*/
|
||||
border: 1px solid #29bdb9;
|
||||
border-radius: 0px;
|
||||
background: #29bdb9;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
line-height: 28px;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
margin-top: 15px;
|
||||
}
|
||||
.mybtn{
|
||||
float: left;
|
||||
margin-left: 10px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
.contentBox{margin-top: 20px;font-size: 14px;overflow: hidden;}
|
||||
.contentBox .navLeft{float: left;display: inline-block;width: 16.4%;background:rgb(41,186,185);}
|
||||
.contentBox .navLeft dl{}
|
||||
.contentBox .navLeft dl dt{height: 40px;line-height: 40px;background:rgb(37,172,169);padding-left: 10px;font-size: 14px;color:white;cursor: pointer; }
|
||||
.icon-w{float: right;position: relative;top: 50%;transform: translateY(-50%);margin-right: 10px;}
|
||||
.icon-f{margin-right: 10px;}
|
||||
.contentBox .navLeft dl dd{text-align: center;;color: white;height: 40px;line-height: 40px;cursor: pointer; }
|
||||
.contentBox .navLeft dl dd a{color: white}
|
||||
.contentBox .newsRight{float: left;display: inline-block;width:83%;background:white;min-height: 279px;}
|
||||
.user_list{padding: 0px;}
|
||||
.info-cnt{padding-top:0px;background: #f5f5f6; }
|
||||
.photoBox{display: none;}
|
||||
.navLeft dl dd i {width: 17px;height: 14px;display: inline-block;background: url(../../images/icon-erro.png) no-repeat;margin: 0px 4px;position: relative;top: 1px;margin-left: 0px;
|
||||
}
|
||||
.icon-h {
|
||||
font-size: 14px;
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.acm-container{/*position: relative;top: -20px;*/padding-bottom: 200px;}
|
||||
.info-cnt {
|
||||
padding-top:0px;
|
||||
padding-bottom:0px;
|
||||
|
||||
}
|
||||
.footer{margin-top: 0px!important;}
|
||||
.headlogotable{float: right;}
|
||||
.info-rBox{padding-bottom: 40px!important;}
|
||||
.navLeft .list a dd:hover{background:#52cdc8}
|
||||
.contentBox .navLeft dl dt:hover{background:#52cdc8 }
|
||||
.head .logo {
|
||||
padding-top: 0px;
|
||||
float: left;
|
||||
display: -webkit-box;
|
||||
line-height: 59px;
|
||||
}
|
||||
.head .logo a{
|
||||
max-width: 120px;
|
||||
height: 55px;
|
||||
line-height: 55px;
|
||||
text-align: center;
|
||||
display: block;
|
||||
}
|
||||
.head .logo img{
|
||||
float: none;
|
||||
max-width: 100%;
|
||||
max-height: 100%
|
||||
}
|
||||
.head .logo p {
|
||||
float: none;
|
||||
line-height: 59px;
|
||||
padding-left: 12px;
|
||||
}
|
||||
.weixinPng:hover img:nth-child(2){display: block}
|
@ -0,0 +1,97 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="Zh-hans" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>个人信息 - 探果网</title>
|
||||
<link rel="stylesheet" th:href="${domainName + 'static/css/reset.css' }" />
|
||||
<link rel="stylesheet" th:href="${domainName + 'static/css/member/booklist.css' }" />
|
||||
<link rel="stylesheet" th:href="${domainName + 'static/css/member/memberMain.css'}" />
|
||||
<link rel="stylesheet" th:href="${domainName + 'static/css/amazeui/css/amazeui.css'}">
|
||||
<link type="favicon" rel="shortcut icon" th:href="${domainName + 'static/images/favicon.png'}" />
|
||||
<!-- 引入样式 -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.4.2/lib/theme-chalk/index.css">
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
line-height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
.avatar {
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 头部-->
|
||||
<div class="head" th:fragment="memberHeader">
|
||||
<div class="head-bar public">
|
||||
<div class="logo">
|
||||
<a th:href="${tamguoDomainName}">
|
||||
<img th:src="${domainName + 'static/images/logo_731bc32.png'}">
|
||||
</a>
|
||||
<p><span>考试中心</span></p>
|
||||
</div>
|
||||
<ul class="nav">
|
||||
<li><a th:href="${domainName + 'index.html'}">首页</a></li>
|
||||
<li class="active"><a th:href="${domainName + 'booklist.html'}">书籍</a></li>
|
||||
<li><a th:href="${domainName + 'account.html'}">帐号</a></li>
|
||||
</ul>
|
||||
<div class="mguser">
|
||||
<div class="mguser-box">
|
||||
<span th:text="${session.currMember.username}">tamguo</span>
|
||||
<a th:href="${domainName + 'logout.html'}">退出</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="banner_list">
|
||||
<div class="cnav">
|
||||
<div class="public cnav_b">
|
||||
<div class="cnav_left">
|
||||
探果五步曲
|
||||
</div>
|
||||
<div class="cnav_right">
|
||||
<ul>
|
||||
<li><span class="Cnav_t">1</span><b>新建书籍</b></li>
|
||||
<li><span>2</span>添加章节</li>
|
||||
<li><span>3</span>添加内容</li>
|
||||
<li><span>4</span>发布试卷</li>
|
||||
<li><span>5</span>等待收益</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="container" class="plist test_public prof_t ng-scope">
|
||||
|
||||
</div>
|
||||
<!-- 尾部-->
|
||||
<div th:replace="include/footer :: footer"></div>
|
||||
</body>
|
||||
|
||||
<!-- 引入组件库 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/axios@0.18.0/dist/axios.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/element-ui@2.4.2/lib/index.js"></script>
|
||||
<script type="text/javascript" th:inline="javascript">
|
||||
var mainHttp = [[${domainName}]];
|
||||
var bookDomainName = [[${bookDomainName}]];
|
||||
</script>
|
||||
</html>
|
@ -0,0 +1,9 @@
|
||||
package com.tamguo.modules.sys.service;
|
||||
|
||||
import org.apache.commons.mail.EmailException;
|
||||
|
||||
public interface IEmailService {
|
||||
|
||||
public Integer sendFindPasswordEmail(String email , String subject) throws EmailException;
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.tamguo.modules.sys.service.impl;
|
||||
|
||||
import org.apache.commons.mail.EmailException;
|
||||
import org.apache.commons.mail.HtmlEmail;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.tamguo.common.utils.SystemConstant;
|
||||
import com.tamguo.config.redis.CacheService;
|
||||
import com.tamguo.modules.sys.service.IEmailService;
|
||||
|
||||
@Service
|
||||
public class EmailService implements IEmailService{
|
||||
|
||||
@Autowired
|
||||
private CacheService cacheService;
|
||||
|
||||
@Override
|
||||
public Integer sendFindPasswordEmail(String email , String subject) throws EmailException {
|
||||
HtmlEmail mail = new HtmlEmail();
|
||||
mail.setHostName(SystemConstant.ALIYUN_SMTP_HOST_NAME);
|
||||
mail.setSmtpPort(SystemConstant.ALIYUN_SMTP_HOST_PORT);
|
||||
mail.setAuthentication(SystemConstant.ALIYUN_MAIL_ACCOUNT, SystemConstant.ALIYUN_MAIL_PASSWORD);
|
||||
mail.setSSLOnConnect(true);
|
||||
mail.setFrom(SystemConstant.ALIYUN_MAIL_ACCOUNT, "探果网");
|
||||
mail.addTo(email);
|
||||
mail.setSubject(subject);
|
||||
mail.setCharset("UTF-8");
|
||||
Integer vcode = (int) ((Math.random()*9+1)*100000);
|
||||
mail.setHtmlMsg("探果网找回密码验证码:"+vcode);
|
||||
mail.send();
|
||||
|
||||
cacheService.setObject(SystemConstant.ALIYUN_MAIL_FIND_PASSWORD_PREFIX + email , vcode.toString() , 3 * 60);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue