Authored by htoooth

add

... ... @@ -5,10 +5,18 @@
'use strict';
const service = require('../models/ads-service');
const config = global.yoho.config;
const helpers = global.yoho.helpers;
const jump = (req, res, next) => {
service.jump().catch(next);
const jump = (req, res) => {
let _QYH_UNION = req.query._QYH_UNION || '';
let target = req.query.target || '';
res.cookie('_QYH_UNION', _QYH_UNION, {
domain: config.cookieDomain
});
res.redirect(target || helpers.urlFormat(''));
};
module.exports = {
... ...
/**
* Created by TaoHuang on 2016/11/8.
*/
'use strict';
const Promise = global.Promise;
const jump = () => {
return Promise.reject();
};
module.exports = {
jump
};
... ... @@ -9,10 +9,10 @@
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
const adsService = require(`${cRoot}/ads`); // 第三方广告平台对接
const ads = require(`${cRoot}/ads`); // 第三方广告平台对接
// Your controller here
router.get('/ads', adsService.jump);
router.get('/ads', ads.jump);
module.exports = router;
... ...