Merge branch 'master' into yohobuy_portak_dev_v4.8_20160620
# Conflicts: # code/libs/Interfacer.js
Showing
4 changed files
with
6 additions
and
31 deletions
@@ -80,6 +80,7 @@ module.exports={ | @@ -80,6 +80,7 @@ module.exports={ | ||
80 | {name: 'maxSortId', type: 'Number'}, | 80 | {name: 'maxSortId', type: 'Number'}, |
81 | {name: 'middleSortId', type: 'Number'}, | 81 | {name: 'middleSortId', type: 'Number'}, |
82 | {name: 'smallSortId', type: 'Number'}, | 82 | {name: 'smallSortId', type: 'Number'}, |
83 | + {name: 'seasons', type: 'String'}, | ||
83 | {name: 'productStandardRelationStr', type: 'String'} | 84 | {name: 'productStandardRelationStr', type: 'String'} |
84 | ] | 85 | ] |
85 | }, | 86 | }, |
@@ -114,37 +114,6 @@ function __requestApi(config, apiOpt, req, callback) { | @@ -114,37 +114,6 @@ function __requestApi(config, apiOpt, req, callback) { | ||
114 | }, function (result) { | 114 | }, function (result) { |
115 | return callback(result, null); | 115 | return callback(result, null); |
116 | }, {len:1}, 0, []); | 116 | }, {len:1}, 0, []); |
117 | - //Request(options, function (error, response, body) { | ||
118 | - // var _err_ = new Error(); | ||
119 | - // if (error) { | ||
120 | - // console.info("Error [request"+options.url+"]:" + options.title); | ||
121 | - // console.error(error); | ||
122 | - // return callback(error, null); | ||
123 | - // } | ||
124 | - // try { | ||
125 | - // if (response && response.statusCode === 200) { | ||
126 | - // var obj = JSON.parse(body) | ||
127 | - // if (!(typeof obj == "object")) { | ||
128 | - // _err_.message = "Error[json parse@" + options.title + "--"+options.url+"]:" + body; | ||
129 | - // console.info(_err_.message); | ||
130 | - // console.error(_err_); | ||
131 | - // return callback(_err_, null); | ||
132 | - // } | ||
133 | - // } else { | ||
134 | - // _err_.message = "Error[response state @" + options.title + "--"+options.url+"]:" + response; | ||
135 | - // console.info(_err_.message); | ||
136 | - // console.error(_err_); | ||
137 | - // return callback(_err_, null); | ||
138 | - // } | ||
139 | - | ||
140 | - // } catch (err) { | ||
141 | - // console.info("Error[response to json @" + options.title + "--"+options.url+"]"); | ||
142 | - // console.info(response); | ||
143 | - // console.error(err); | ||
144 | - // return callback(err, null); | ||
145 | - // } | ||
146 | - // return callback(null, JSON.parse(body)); | ||
147 | - //}); | ||
148 | }; | 117 | }; |
149 | 118 | ||
150 | function __requestOption(req, apiOpt, config, consts) { | 119 | function __requestOption(req, apiOpt, config, consts) { |
@@ -4,6 +4,7 @@ module.exports = { | @@ -4,6 +4,7 @@ module.exports = { | ||
4 | queryRefundExchangeList: { | 4 | queryRefundExchangeList: { |
5 | title: '特殊商品列表数据', | 5 | title: '特殊商品列表数据', |
6 | url: '/refundExchangeAttribute/queryRefundExchangeList', | 6 | url: '/refundExchangeAttribute/queryRefundExchangeList', |
7 | + timeout:3000, | ||
7 | params: [ | 8 | params: [ |
8 | {name: 'productSkn', type: 'Number'}, | 9 | {name: 'productSkn', type: 'Number'}, |
9 | {name: 'brandId', type: 'Number'}, | 10 | {name: 'brandId', type: 'Number'}, |
@@ -132,6 +132,7 @@ function __requestApi(config, apiOpt, req, callback) { | @@ -132,6 +132,7 @@ function __requestApi(config, apiOpt, req, callback) { | ||
132 | } | 132 | } |
133 | } else { | 133 | } else { |
134 | _err_.message = "Error[response state @" + options.title + "--"+options.url+"]:" + response; | 134 | _err_.message = "Error[response state @" + options.title + "--"+options.url+"]:" + response; |
135 | + console.log(response); | ||
135 | console.info(_err_.message); | 136 | console.info(_err_.message); |
136 | console.error(_err_); | 137 | console.error(_err_); |
137 | return callback(_err_, null); | 138 | return callback(_err_, null); |
@@ -240,6 +241,9 @@ function __requestOption(req, apiOpt, config, consts) { | @@ -240,6 +241,9 @@ function __requestOption(req, apiOpt, config, consts) { | ||
240 | if (req._yoheaders) { | 241 | if (req._yoheaders) { |
241 | options.headers = _.merge(options.headers, req._yoheaders); | 242 | options.headers = _.merge(options.headers, req._yoheaders); |
242 | } | 243 | } |
244 | + if(apiOpt.timeout){ | ||
245 | + options.timeout=apiOpt.timeout; | ||
246 | + } | ||
243 | console.log("*************************************"); | 247 | console.log("*************************************"); |
244 | console.log("Http", options.url, data, options.headers); | 248 | console.log("Http", options.url, data, options.headers); |
245 | console.log("*************************************"); | 249 | console.log("*************************************"); |
-
Please register or login to post a comment