Authored by shuaiguo

feat(feature): 领券防刷

... ... @@ -9,6 +9,8 @@ const model = require('../models/feature');
const _ = require('lodash');
const stringProcess = require('../../../utils/string-process');
const config = global.yoho.config;
exports.index = function(req, res, next) {
let qcdn = _.get(req.app.locals, 'wap.qcloud_cdn');
... ... @@ -34,6 +36,7 @@ exports.index = function(req, res, next) {
page: 'feature',
title: title,
content: result,
captchaAppId: config.captcha.appId ,
activity_id: req.params.code,
isFeature: true,
wechatShare: true,
... ...
... ... @@ -304,5 +304,6 @@
<input type="hidden" value="{{content.atlBo}}" class="activity-plan">
<input type="hidden" value="{{content.templateId}}" class="template-id">
<input type="hidden" value="{{content.id}}" class="activity-id">
<div class="yoho-tencentCaptcha" data-appid="{{captchaAppId}}" data-open="1"><div>
{{/unless}}
</div>
... ...
... ... @@ -135,7 +135,7 @@ module.exports = {
geetestJs: '//static.geetest.com/static/tools/gt.js',
// jsSdk: '//cdn.yoho.cn/js-sdk/1.3.24/jssdk.js',
jsSdk: 'https://cdn.yoho.cn/js-sdk/1.3.25/jssdk.js',
jsSdk: 'https://cdn.yoho.cn/js-sdk/1.3.26-beta3/jssdk.js',
redis: {
connect: {
host: '192.168.102.49',
... ... @@ -163,7 +163,7 @@ module.exports = {
port: '6379',
pass: '',
prefix: 'yohobuy_session:'
}
},
},
REQUEST_LIMIT: {
// 10s 最多访问20次
... ... @@ -180,7 +180,12 @@ module.exports = {
},
LIMITER_IP_TIME: 3600, // 超出访问限制ip限制访问1小时
superCapture: '93c70db61fe276f93ce781ad17dc47cd',
from: from
from: from,
// 优惠券防刷腾讯云验证码
captcha: {
appId: 2008945059
}
};
if (isProduction) {
... ...