Authored by weiqingting

提交

... ... @@ -490,5 +490,5 @@ $('#sure-change').on('click', function() {
});
$('#download-btn').on('click', function() {
location.href = $(this).data('domain') + '/batch/download?path=' + path;
location.href = $(this).data('domain') + '/ajax/download?path=' + path;
});
\ No newline at end of file
... ...
... ... @@ -75,6 +75,9 @@ module.exports = {
'/ajax/upload':function(req,res){
uploader.uploadFile(req,res);
},
'/ajax/download':function(req,res){
uploader.download(req,res);
},
'/ajax/down':function(req,res){
uploader.downFile(req,res);
},
... ...
... ... @@ -238,6 +238,19 @@ exports.downFile = function(req, res) {
request(options).pipe(res);
};
exports.download=function(req,res){
var options = {
method: 'POST',
url: '/batch/download',
headers: {
'content-type': 'application/json'
},
body: req.query,
json: true
};
request(options).pipe(res);
}
exports.proxy = function(req,res) {
var headers = getHeader(req, res);
headers['Content-Type'] = 'application/json';
... ...