Authored by 郭成尧

send-success-page

... ... @@ -82,11 +82,18 @@ class BackNew {
* 通过邮箱找回密码成功页
*/
backByEmailSuccess(req, res) {
let email = req.query.email || '';
if (!helpers.verifyEmail(email)) {
res.redirect(400);
}
res.render('back/email-success-new', {
width750: true,
localCss: true,
module: 'passport',
page: 'back-email-success-new'
page: 'back-email-success-new',
doneUrl: helpers.urlFormat('/signin.html'),
resendUrl: helpers.urlFormat('/passport/back/resendemail', { email: email })
});
}
}
... ...
... ... @@ -9,8 +9,9 @@
<p class="info">请在24小时内通过邮件内的链接设置新密码</p>
</div>
<div class="form-group back-email-success-btn">
<button id="backEmailSuccessBtn">完 成</button>
<button id="backEmailSuccessBtn" onclick="location.href='{{doneUrl}}'">完 成</button>
</div>
<input type="hidden" name="resendUrl" value="{{resendUrl}}">
<div class="form-group resend-email-btn">
<button id="resendEmailBtn">重新发送邮件</button>
</div>
... ...
require('passport/back-email-success-new.page.css');
import $ from 'yoho-jquery';
import BackEmailSuccessNew from './back/email-success-new';
$(() => {
new BackEmailSuccessNew();
});
... ...
import $ from 'yoho-jquery';
import Page from 'yoho-page';
import tip from 'plugin/tip';
class EmailSuccessNew extends Page {
constructor() {
super();
this.selector = {
resendUrlInput: $('input[name=resendUrl]'),
resendEmailBtn: $('#resendEmailBtn')
};
this.selector.resendEmailBtn.on('click', this.resendEmail.bind(this));
}
/**
* 重新发送验证码
*/
resendEmail() {
this.ajax({
url: this.selector.resendUrlInput.val(),
type: 'GET',
}).then(result => {
tip.show(result.message);
}).catch(error => {
console.error(error);
});
}
}
module.exports = EmailSuccessNew;
... ...