Authored by weiqingting

Merge branch 'master' into yohobuy_portak_dev_v4.8_20160620

# Conflicts:
#	code/libs/Interfacer.js
... ... @@ -80,6 +80,7 @@ module.exports={
{name: 'maxSortId', type: 'Number'},
{name: 'middleSortId', type: 'Number'},
{name: 'smallSortId', type: 'Number'},
{name: 'seasons', type: 'String'},
{name: 'productStandardRelationStr', type: 'String'}
]
},
... ...
... ... @@ -114,37 +114,6 @@ function __requestApi(config, apiOpt, req, callback) {
}, function (result) {
return callback(result, null);
}, {len:1}, 0, []);
//Request(options, function (error, response, body) {
// var _err_ = new Error();
// if (error) {
// console.info("Error [request"+options.url+"]:" + options.title);
// console.error(error);
// return callback(error, null);
// }
// try {
// if (response && response.statusCode === 200) {
// var obj = JSON.parse(body)
// if (!(typeof obj == "object")) {
// _err_.message = "Error[json parse@" + options.title + "--"+options.url+"]:" + body;
// console.info(_err_.message);
// console.error(_err_);
// return callback(_err_, null);
// }
// } else {
// _err_.message = "Error[response state @" + options.title + "--"+options.url+"]:" + response;
// console.info(_err_.message);
// console.error(_err_);
// return callback(_err_, null);
// }
// } catch (err) {
// console.info("Error[response to json @" + options.title + "--"+options.url+"]");
// console.info(response);
// console.error(err);
// return callback(err, null);
// }
// return callback(null, JSON.parse(body));
//});
};
function __requestOption(req, apiOpt, config, consts) {
... ...
... ... @@ -4,6 +4,7 @@ module.exports = {
queryRefundExchangeList: {
title: '特殊商品列表数据',
url: '/refundExchangeAttribute/queryRefundExchangeList',
timeout:3000,
params: [
{name: 'productSkn', type: 'Number'},
{name: 'brandId', type: 'Number'},
... ...
... ... @@ -132,6 +132,7 @@ function __requestApi(config, apiOpt, req, callback) {
}
} else {
_err_.message = "Error[response state @" + options.title + "--"+options.url+"]:" + response;
console.log(response);
console.info(_err_.message);
console.error(_err_);
return callback(_err_, null);
... ... @@ -240,6 +241,9 @@ function __requestOption(req, apiOpt, config, consts) {
if (req._yoheaders) {
options.headers = _.merge(options.headers, req._yoheaders);
}
if(apiOpt.timeout){
options.timeout=apiOpt.timeout;
}
console.log("*************************************");
console.log("Http", options.url, data, options.headers);
console.log("*************************************");
... ...