0.0.1 • Published 2 years ago
tools-untils v0.0.1
download and install
npm install file-tools -D
introduce
improt download from 'file-tools'
method
exceptionDownload:根据后端返回url进行下载(不推荐使用)
flowExport:根据后端返回流文件进行下载
File configuration
exceptionDownload:不建议使用
根据后端返回的URL下载
配置参数
fullName:文件名称
url: 后端返回的url地址
b:文件后缀
time:下载时是否需要拼接时间,在下载名称拼接,例如: '文件2021-3-1 12:12:12.xls'
默认值:new Date(),
timeFormat:时间的格式
默认值:'YYYY-MM-DD HH:mm:ss'
flowExport: 建议使用
根据后端返回的文件流下载
配置参数
content:后端出入的流文件
name:自定义导出文件的名字
suffix:可自定义后端返回文件格式,默认为xls
默认值:'.xls',
time:下载时是否需要拼接时间,在下载名称拼接,例如: '文件2021-3-1 12:12:12.xls'
默认值:new Date(),
timeFormat:时间的格式
默认值:'YYYY-MM-DD HH:mm:ss'
0.0.1
2 years ago