json转换csv并进行下载

context.setVariable('response.header.Content-Type', 'application/csv; charset=utf-8');
context.setVariable('response.header.Content-Disposition','attachment; filename="consumption_'+getCurrentTimeStamp()+'.csv"')
var csv = JSONToCSV(response);
context.setVariable('response.content',csv);

posted @ 2019-11-04 11:40  HooliJia  阅读(500)  评论(0编辑  收藏  举报