vue端处理
this.$http.get(this.service + '/user/excel',{responseType: 'blob'}).then(({data})=> { console.info(typeof data) var a = document.createElement('a'); var url = window.URL.createObjectURL(data); a.href = url; a.download = '用户统计信息.xls'; a.click(); window.URL.revokeObjectURL(url); })
web端处理
int total=userBsService.getCount(null); Listlist=userBsService.getList(null, 1, total); String fileName = new Date().getTime() + ""; XSSFWorkbook wb=new XSSFWorkbook(); Sheet sheet=wb.createSheet(); Row row0=sheet.createRow(0); String titleName[] = {"用户账号", "充值总金额", "邀请总人数", "社群组"};//列名 for(int i=0;i