下载文件后是临时文件路径(blob:http://localhost:8080/9e6727d7-9972-4fe7-ba8e-4c153df4fba8),如何才能在微信环境下打开这个文件
浏览器里面可以自动下载,但是在微信h5环境 uni.openDocument 是无效的,还有什么方法可以解决这个问题吗?
uni.downloadFile({  
                    url: this.http.requstUrl,  
                    success: (res) => {  
                        if (res.statusCode === 200) {  
                            this.$u.toast('下载成功' + res.tempFilePath)  
                            let filePath = res.tempFilePath  
                            let system = uni.getSystemInfoSync().platform;  
                            let _this = this  
                            if(system == 'ios'){filePath = encodeURI(res.tempFilePath);}  
                            uni.openDocument({  
                                filePath: filePath,  
                                showMenu: true,  
                                success: function (res) {  
                                    uni.$u.toast('打开文档成功')  
                                    console.log('打开文档成功');  
                                },  
                                fail: function (res) {  
                                    //_this.$u.toast('打开文档失败')  
                                    console.log('打开文档失败');  
                                }  
                            });  
                        }  
                        console.log(res)  
                    }  
                }); 
             
             
             
			 
                                        
                                     
            
2 个回复
BoredApe - 有问题就会有答案。
h5不支持openDocument。只能引导用户在右上角通过浏览器打开topeam
请问解决了吗