...
|
...
|
@@ -12,6 +12,8 @@ const log = global.yoho.logger; |
|
|
const sign = global.yoho.sign;
|
|
|
const config = global.yoho.config;
|
|
|
|
|
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
|
|
|
|
const loginPage = '//m.yohobuy.com/signin.html';
|
|
|
const homePage = `${config.siteUrl}/xianyu/index/channel`;
|
|
|
|
...
|
...
|
@@ -240,21 +242,23 @@ const bind = { |
|
|
let info = bind.getBindThirdInfo(bindCode);
|
|
|
|
|
|
if (info.type === 'taobao') {
|
|
|
const timeKey = `${config.app}:bindsms:taobao:${info.openId}`;
|
|
|
let sendTimes = await redis.getAsync(timeKey);
|
|
|
if (isProduction) {
|
|
|
const timeKey = `${config.app}:bindsms:taobao:${info.openId}`;
|
|
|
let sendTimes = await redis.getAsync(timeKey);
|
|
|
|
|
|
sendTimes = (sendTimes || 0) + 1;
|
|
|
sendTimes = (sendTimes || 0) + 1;
|
|
|
|
|
|
if (sendTimes > MAX_MSG_SEND_TIMES) {
|
|
|
log.info(`[SMS delivery times exceeded] type: taobao | openId: ${info.openId} | mobile: ${mobile} | ua: ${req.get('user-agent')}`);
|
|
|
if (sendTimes > MAX_MSG_SEND_TIMES) {
|
|
|
log.info(`[SMS delivery times exceeded] type: taobao | openId: ${info.openId} | mobile: ${mobile} | ua: ${req.get('user-agent')}`);
|
|
|
|
|
|
return res.json({
|
|
|
code: 403,
|
|
|
message: '操作频繁,请稍后重试'
|
|
|
});
|
|
|
}
|
|
|
return res.json({
|
|
|
code: 403,
|
|
|
message: '操作频繁,请稍后重试'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
redis.setex(timeKey, 60 * 60 * 2, sendTimes);
|
|
|
redis.setex(timeKey, 60 * 60 * 2, sendTimes);
|
|
|
}
|
|
|
req.ctx(passportModel).sendTaobaoBindCode(mobile, req.yoho.isAliApp ? 'xianyu' : '').then(res.json).catch(next);
|
|
|
} else {
|
|
|
res.json({
|
...
|
...
|
|