微信下载文件重命名并打开
wx.downloadFile({
url: response.data.fileUrl,//文件下载地址比如远程地址
filePath: wx.env.USER_DATA_PATH + '/' + exportFilename + '.xlsx', //exportFilename 自己定义文件名
success: function (res) {
if (res.statusCode == 200) {
let filePath = res.filePath
wx.openDocument({//打开文件
fileType: 'xlsx',
filePath: filePath,
showMenu: true,
})
}
},
fail: function (error) {
toast.error('导出失败')
}
})
您还未登录, 登录 后可进行评论
发表
还没有评论哦,来抢个沙发吧!