Authored by 郭成尧

sendcodeagain

... ... @@ -365,6 +365,20 @@ const setNewPasswordByMobileAPI = (req, res, next) => {
.catch(next);
};
/**
* 直接调用发短信接口的情况
*/
const verifySmsAllow = (req, res, next) => {
if (_.get(req, 'session.backupCaptch.verifyResult')) {
return next();
} else {
return res.json({
code: 400,
message: '非法请求'
});
}
};
module.exports = {
indexEmailPage,
sendCodeToEmailAPI,
... ... @@ -377,5 +391,6 @@ module.exports = {
verifyCodeByMobileAPI,
setNewPasswordByMobilePage,
setNewPasswordByMobileAPI,
generateCodeImg
generateCodeImg,
verifySmsAllow
};
... ...
... ... @@ -134,7 +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/sendcodeagain', back.verifySmsAllow, back.sendCodeToMobileAPI);// 重新发送手机验证码
router.post('/passport/back/verifycode', back.verifyCodeByMobileAPI);// 校验手机验证码
router.get('/passport/back/backcode', back.setNewPasswordByMobilePage);// 设置新密码页面
... ...