- 博客(3)
- 收藏
- 关注
原创 前端调接口返回文件流,通过a标签下载文件
前端调接口返回文件流,通过a标签下载文件/** * @param {*} res 请求返回的所有内容,包含请求头 * @param {*} filename 可不传,用来覆盖请求中返回的文件名称 * @return undefined */function downloadFile(res, filename) { if (!res) { return false } const blob = new Blob([res.data]) const blobUrl
2022-02-09 11:09:59 1057
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人