Authored by 郭成尧

resend-message-code

... ... @@ -205,6 +205,14 @@ const sendCodeToMobileAPI = (req, res, next) => {
return res.json(ERR);
}
// 针对直接调接口的情况
if (!_.get(req, 'session.backupCaptch.verifyResult')) {
return res.json({
code: 400,
message: '非法请求'
});
}
let backCount = _.get(req.session, 'backupCaptch.count'); // 短信验证码 发送次数
if (!backCount) {
... ... @@ -237,6 +245,8 @@ const sendCodeToMobileAPI = (req, res, next) => {
_.set(req.session, 'backupCaptch.timeout', Date.now() + 5 * 60 * 1000);
}
req.session.backupCaptchStep2 = true; // 允许跳到第二步
return res.json({
code: 200,
data: helpers.urlFormat('/passport/back/mobilecode', {
... ...
... ... @@ -134,6 +134,7 @@ router.get('/passport/back/mobile', validateCode.load, back.indexMobilePage);//
router.get('/passport/back/mobilecode', back.verifyCodeByMobilePage);// 输入手机验证码页面
router.get('/passport/back/generatecodeimg.png', back.generateCodeImg);// 生成图片验证码
router.post('/passport/back/sendcode', validateCode.check, back.sendCodeToMobileAPI);// 发送手机验证码
router.post('/passport/back/sendcodeagain', back.sendCodeToMobileAPI);// 重新发送手机验证码
router.post('/passport/back/verifycode', back.verifyCodeByMobileAPI);// 校验手机验证码
router.get('/passport/back/backcode', back.setNewPasswordByMobilePage);// 设置新密码页面
... ...
... ... @@ -118,7 +118,7 @@ module.exports = function(useInRegister, useForBind, useForRelate) {
$.ajax({
type: 'POST',
url: (useForBind || useForRelate) ? '/passport/bind/sendBindMsg' : '/passport/' + urlMid + '/sendcode',
url: (useForBind || useForRelate) ? '/passport/bind/sendBindMsg' : '/passport/' + urlMid + '/sendcodeagain',
data: {
phoneNum: phoneNum,
areaCode: areaCode
... ...