...
|
...
|
@@ -10,6 +10,7 @@ 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;
|
...
|
...
|
@@ -156,7 +157,9 @@ let sendBindMsg = (req, res, next) => { |
|
|
// 检查是否检查过
|
|
|
// let checkNum = yield cache.get(`regCheckMobileNum_${mobile}`);
|
|
|
|
|
|
if (req.session.hasGetSMS) {
|
|
|
//检查上次的发送短信号码
|
|
|
if (captcha.checkSendMobile(req, res, true)) {
|
|
|
req.session.sendMobile = '';
|
|
|
data.message = '发送失败';
|
|
|
return res.json(data);
|
|
|
}
|
...
|
...
|
@@ -176,7 +179,8 @@ let sendBindMsg = (req, res, next) => { |
|
|
|
|
|
return cache.set(sendCodeKey, sendCodeTimes + 1, 3600).then(() => {
|
|
|
if (result.code) {
|
|
|
req.session.hasGetSMS = true;
|
|
|
//记录发送短信的号码
|
|
|
req.session.sendMobile = mobile;
|
|
|
return res.json(result);
|
|
|
} else {
|
|
|
data.message = '发送失败';
|
...
|
...
|
|