URL.createObjectURL()的使用方法 刘永胜是我 2021-09-25 693 阅读1分钟 背景 处理后端返回的文件流,然后进行下载 方法 URL.createObjectURL()的使用方法 const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) const ObjectUrl = window.URL.createObjectURL(blob); window.location.href = ObjectUrl;