1000人艺体艺术波谷,济宁郑媛媛照片全集,贝爷中国节目
后台方法的参数必须是@requestbody修饰的。
前台关键代码:
axios ( { method : 'post', url : api.exportplaytime , // 请求地址 data : { choose : type, begindate : startdate, enddate : enddate }, responsetype : 'arraybuffer', observe: 'response', } ) .then ( ( res ) => { const filename = ""+filename+".xlsx" let blob = new blob([res.data], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}); if ( 'download' in document.createelement ( 'a' ) ) { // 非ie下载 const elink = document.createelement ( 'a' ) elink.download = filename elink.style.display = 'none' elink.href = url.createobjecturl ( blob ) document.body.appendchild ( elink ) elink.click () url.revokeobjecturl ( elink.href ) // 释放url 对象 document.body.removechild ( elink ) } else { // ie10+下载 navigator.mssaveblob ( blob, filename ) } })
download(data) { if (!data) { return } let url = window.url.createobjecturl(new blob([data])) let link = document.createelement('a') link.style.display = 'none' link.href = url link.setattribute('download', 'excel.xlsx') document.body.appendchild(link) link.click() },
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
怎么理解wx.navigateTo的events参数使用详情
微信jssdk踩坑之签名错误invalid signature
网友评论