fetch(Vue.prototype.baseUrl + urls, { method: 'POST', headers: { 'Content-Type': 'text/plain', 'token': JSON.parse(sessionStorage.getItem('ms_username')).token } }) .then(res => res.blob()) .then(data => { let blobUrl = window.URL.createObjectURL(data); const a = document.createElement('a'); a.style.display = 'none'; a.download = [type + '.txt']; a.href = blobUrl; a.click(); if (this.activeName === 'first') { this.getPrintingDetailSKU() } else { this.getPrintingDetail() } });
文件流下载数据
最新推荐文章于 2024-07-23 19:11:17 发布