Authored by shijian

save

... ... @@ -121,8 +121,21 @@ const sendBackMobileAPI = (req, res, next) => {
let mobile = req.body.mobile || '';
let area = req.body.area || '86';
// 检查上次的发送短信号码
if (req.session.sendMobile && req.session.sendMobile !== mobile) {
req.session.sendMobile = '';
req.session.captcha = '';
return res.json({
code: 400,
message: '验证码失效',
data: ''
});
}
BackService.sendCodeToMobileAsync(area, mobile)
.then(result => {
// 记录发送短信的号码
req.session.sendMobile = mobile;
res.json(result);
})
.catch(next);
... ...
... ... @@ -10,7 +10,6 @@ const UserService = require('../models/user-service');
const LoginService = require('../models/login-service');
const config = require('../../../config/common');
const safeRedirect = require('../../../doraemon/middleware/safe-redirect').safeRedirect;
const captcha = require('./captcha');
let helpers = global.yoho.helpers;
let cache = global.yoho.cache;
... ... @@ -158,9 +157,10 @@ let sendBindMsg = (req, res, next) => {
// let checkNum = yield cache.get(`regCheckMobileNum_${mobile}`);
// 检查上次的发送短信号码
if (captcha.checkSendMobile(req, res, true)) {
if (req.session.sendMobile && req.session.sendMobile !== mobile) {
req.session.sendMobile = '';
data.message = '发送失败';
req.session.captcha = '';
data.message = '验证码失效';
return res.json(data);
}
... ...
... ... @@ -575,11 +575,11 @@ exports.init = function() {
}
$smsCaptchaCtrl.addClass('disable');
disableSMSBtn();
sendSMSCaptcha().then((data)=>{
if (data.code !== 200) {
errTip($smsCaptchaInput, data.message);
errTip($imgCaptchaInput, data.message);
refreshImgCaptcha();
} else {
hideTip($smsCaptchaInput);
... ...