Authored by 郝肖肖

'request-baseurl'

... ... @@ -3,15 +3,15 @@
* @author: xiaoxiao<xiaoxiao.hao@yoho.cn>
* @date: 2018/01/4
*/
'use strict';
const request = require('request-promise');
const querystring = require('querystring');
const index = (req, res, next) => {
const miniapp = (req, res, next) => {
return request({
url: `${global.yoho.config.domains.api}wechat/miniapp/img-check.jpg?${querystring.stringify(req.query)}`,
baseUrl: global.yoho.config.domains.api,
uri: 'wechat/miniapp/img-check.jpg',
qs: req.query,
headers: {
'X-request-ID': req.reqID || '',
'X-YOHO-IP': req.yoho.clientIp || '',
... ... @@ -22,5 +22,5 @@ const index = (req, res, next) => {
};
module.exports = {
index
miniapp
};
... ...
... ... @@ -24,6 +24,6 @@ router.post('/hf/v1', hotfix.v1);
router.post('/rn/v1', rn.v1);
router.get('/.well-known/apple-app-site-association', apple.appSiteAssociation);
router.get('/mini-check.jpg', forward.index);
router.get('/wechat/miniapp.jpg', forward.miniapp);
module.exports = router;
... ...
... ... @@ -73,7 +73,7 @@ const newDetail = {
pageFooter: true,
localCss: true,
appPath: appPath,
miniPath: helpers.urlFormat('/mini-check.jpg', {
miniPath: helpers.urlFormat('/wechat/miniapp.jpg', {
miniapp_type: 0,
param: result.productSkn,
miniQrType: 1
... ...
... ... @@ -191,7 +191,7 @@ const shop = {
}
// param:品牌ID, name:品牌名称, miniQrType 1:商品 2 品牌,miniapp_type 0:有货,1:新与力
let miniPath = helpers.urlFormat('/mini-check.jpg', {
let miniPath = helpers.urlFormat('/wechat/miniapp.jpg', {
miniapp_type: 0,
param: _.get(brands, '[0].brand_id', 0),
name: encodeURIComponent(_.get(brands, '[0].brand_name', '')),
... ...