Authored by TaoHuang

feat(coupon): void captcha init in miniapp

... ... @@ -14,6 +14,9 @@ const config = global.yoho.config;
exports.index = function(req, res, next) {
let qcdn = _.get(req.app.locals, 'wap.qcloud_cdn');
// 小程序下验证服务不可用
let isMiniapp = /miniProgram/i.test(req.get('userAgent') || '');
req.ctx(model).index({
code: req.params.code,
type: stringProcess.paramsFilter(req.query.type),
... ... @@ -40,6 +43,7 @@ exports.index = function(req, res, next) {
activity_id: req.params.code,
isFeature: true,
wechatShare: true,
isMiniapp,
loadJs: [{
src: qcdn ? jsSdk.replace(/\/\/cdn.yoho.cn/gi, '//qcdn.yoho.cn') : jsSdk
}]
... ...
... ... @@ -305,6 +305,8 @@
<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}}"><div>
{{#unless isMiniapp}}
<div class="yoho-tencentCaptcha" data-appid="{{captchaAppId}}"><div>
{{/unless}}
{{/unless}}
</div>
... ...