Authored by 毕凯

移除 API 签名

... ... @@ -6,16 +6,15 @@
'use strict';
const ServiceAPI = require(`${global.library}/api`).ServiceAPI;
const sign = require(`${global.library}/sign`);
const logger = require(`${global.library}/logger`);
const headerModel = require('../../../doraemon/models/header');
var api = new ServiceAPI();
const _getstaticFile = (id) => {
return api.get('activity/staticFileManage/queryById', sign.apiSign({
return api.get('activity/staticFileManage/queryById', {
id: id
}), {
}, {
cache: true
}).then(result => {
if (result && result.code === 200) {
... ...
... ... @@ -11,7 +11,6 @@ const dataMap = require('../../../config/data-map');
const ServiceAPI = require(`${global.library}/api`).ServiceAPI;
const SearchAPI = require(`${global.library}/api`).SearchAPI;
const sign = require(`${global.library}/sign`);
const helpers = require(`${global.library}/helpers`);
const images = require(`${global.utils}/images`);
... ... @@ -761,16 +760,13 @@ const getAccordionFloorData = args => {
};
const requestContent = type => {
let data = sign.apiSign({
/* eslint-disable */
client_type: 'web',
/* eslint-enable */
let data = {
client_type: 'web',
content_code: channelMap[type || 'boys'].code,
gender: channelMap[type || 'boys'].gender,
page: 1,
limit: 1000
});
};
return serviceApi.get('operations/api/v5/resource/home', data).then(res => {
if (res.code === 200) {
... ...
... ... @@ -19,7 +19,7 @@ class Auth {
param.shopping_key = shoppingKey;
}
return api.get('', sign.apiSign(param));
return api.get('', param);
}
static signinByWechat(nickname, openId, unionId, sourceType, shoppingKey) {
... ... @@ -35,7 +35,7 @@ class Auth {
param.shopping_key = shoppingKey;
}
return api.get('', sign.apiSign(param));
return api.get('', param);
}
static profile(uid) {
... ... @@ -44,7 +44,7 @@ class Auth {
method: 'app.passport.profile'
};
return api.get('', sign.apiSign(param));
return api.get('', param);
}
static syncUserSession(uid, req, res) {
... ...
... ... @@ -11,7 +11,6 @@ const API = require(`${library}/api`).API;
const ServiceAPI = require(`${global.library}/api`).ServiceAPI;
const serviceApi = new ServiceAPI();
const api = new API();
const sign = require(`${library}/sign`);
const _ = require('lodash');
const yhChannel = {
... ... @@ -45,14 +44,14 @@ exports.getOutletsActivityOrigin = (params) => {
let tempChannel = params.channel || 'boys';
return api.get('', sign.apiSign({
return api.get('', {
method: 'app.outlets.activityGet',
id: params.id || null,
platform: params.platform || 1,
size: params.size || 0,
yh_channel: yhChannel[tempChannel].channel,
type: params.type || 0
}));
});
};
/**
... ... @@ -61,7 +60,7 @@ exports.getOutletsActivityOrigin = (params) => {
* @return {[type]}
*/
exports.getChannelResouceData = (params) => {
return serviceApi.get('operations/api/v5/resource/home', sign.apiSign(params));
return serviceApi.get('operations/api/v5/resource/home', params);
};
/**
... ... @@ -72,7 +71,7 @@ exports.getChannelResouceData = (params) => {
exports.getOutletsTrendData = (params) => {
let tempChannel = params.channel || 'boys';
return api.get('', sign.apiSign({
return api.get('', {
method: 'app.search.trend',
yh_channel: yhChannel[tempChannel].channel,
order: params.order || 's_s_desc,s_n_desc',
... ... @@ -80,7 +79,7 @@ exports.getOutletsTrendData = (params) => {
stocknumber: 1, // 过滤出库存 > 1的商品
limit: params.limit || 5,
outlets: params.outlets || 1 // 默认取奥莱商品
}));
});
};
... ... @@ -113,5 +112,5 @@ exports.getOutletsGoodsList = (params) => {
tempParams[paramsName] = params[paramsName];
}
});
return api.get('', sign.apiSign(tempParams));
return api.get('', tempParams);
};
... ...
... ... @@ -11,7 +11,6 @@ const API = require(`${library}/api`).API;
const ServiceAPI = require(`${library}/api`).ServiceAPI;
const api = new API();
const serviceAPI = new ServiceAPI();
const sign = require(`${library}/sign`);
const _ = require('lodash');
const yhChannel = {
... ... @@ -47,7 +46,7 @@ exports.getSaleGoodsList = (params) => {
Object.assign(finalParams, params);
return api.get('', sign.apiSign(finalParams));
return api.get('', finalParams);
};
/**
... ... @@ -57,10 +56,10 @@ exports.getSaleGoodsList = (params) => {
exports.getSalebreakingYardsSortList = (params) => {
let tempChannel = _.isEmpty(params.channel) ? 'boys' : params.channel;
return api.get('', sign.apiSign({
return api.get('', {
method: 'app.sale.getBreakingSort',
yh_channel: yhChannel[tempChannel].channel
}));
});
};
/**
... ... @@ -70,13 +69,13 @@ exports.getSalebreakingYardsSortList = (params) => {
exports.getSaleActivityList = (params, channel) => {
let tempChannel = _.isEmpty(channel) ? 'boys' : channel;
return api.get('', sign.apiSign({
return api.get('', {
id: params.id || null,
method: 'app.activity.get',
sort: '2',
plateform: '1',
yh_channel: yhChannel[tempChannel].channel
}));
});
};
/**
... ... @@ -84,9 +83,9 @@ exports.getSaleActivityList = (params, channel) => {
* @return {[type]} [description]
*/
exports.getSaleBannerList = (cCode) => {
return serviceAPI.get('operations/api/v5/resource/get', sign.apiSign({
return serviceAPI.get('operations/api/v5/resource/get', {
content_code: cCode
}));
});
};
/**
... ... @@ -94,9 +93,9 @@ exports.getSaleBannerList = (cCode) => {
* @return {[type]} [description]
*/
exports.getLeftContentList = () => {
return api.get('', sign.apiSign({
return api.get('', {
method: 'app.sort.get'
}));
});
};
/**
... ... @@ -111,8 +110,8 @@ exports.getUserProfile = (uid) => {
data: {}
});
}
return api.get('', sign.apiSign({
return api.get('', {
method: 'app.passport.profile',
uid: uid
}), true);
}, true);
};
... ...