...
|
...
|
@@ -2,28 +2,15 @@ var request = require('request'); |
|
|
var _ = require('lodash');
|
|
|
var fs = require('fs');
|
|
|
var ipaddr = require('ipaddr.js');
|
|
|
var domain = "http://172.16.6.162:8088/platform";//require('../../config/common.js').domain;
|
|
|
var domain = require('../../config/common.js').domain;
|
|
|
|
|
|
exports.downFile = function(req, res) {
|
|
|
request
|
|
|
.post({
|
|
|
url:'http://172.16.6.240:8088/platform/batch/export',
|
|
|
var options = {
|
|
|
method: 'POST',
|
|
|
url: domain+'/batch/export',
|
|
|
headers: { 'content-type': 'application/json' },
|
|
|
json: true,
|
|
|
formData: { queryConf: '2016030711350185', type: 'limitProductReminder' },//req.body
|
|
|
})
|
|
|
.on('response', function(response) {
|
|
|
var status=response.statusCode;
|
|
|
if(status>=200&&status<300||status==304){
|
|
|
console.log("下载成功");
|
|
|
}else{
|
|
|
console.log("下载失败");
|
|
|
}
|
|
|
})
|
|
|
.on('error', function(err) {
|
|
|
var msg= typeof err==='object'?err.message:err;
|
|
|
console.log("error");
|
|
|
console.log(msg.error);
|
|
|
})
|
|
|
.pipe(res);
|
|
|
body: req.query,
|
|
|
json: true
|
|
|
};
|
|
|
request(options).pipe(res);
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|