uniapp下载文件

		// 下载文件
        downloadFile(url) {
            uni.downloadFile({
                url: url,
                success: function (res) {
                    var filePath = res.tempFilePath
                    uni.openDocument({
                        filePath: filePath,
                        showMenu: true,
                        success: function (res) {
                            console.log('打开文档成功')
                        }
                    })
                }
            })
        },

你可能感兴趣的:(uni-app,javascript,前端)