zoukankan      html  css  js  c++  java
  • 关于移动端影像配置了https之后拍出来的照片在android手机无法显示的问题

    话不多说上代码

    // 函数-从url读取文件
                readFile(img){
                    let vm = this;
                    window.resolveLocalFileSystemURL(img.orgSrc, function(fileEntry) {
                        fileEntry.file(function (file) {
                            let reader = new FileReader();
                            let reader2 = new FileReader();
                            reader.readAsArrayBuffer(file);
                            reader2.readAsDataURL(file);
    
                            reader2.onloadend = function (e) {
                                console.log(e);
                                console.log(JSON.stringify(e));
                                let image = {
                                    thumbnailurl:this.result,
                                    // address:fileEntry.toInternalURL(), //address
                                    imageId :img.imageId,
                                    orgSrc:img.orgSrc, //file_path
                                    imageName:img.imageName, //file_name
                                };
                                vm.imgList.push(image);
                            };
    
    
                            reader.onloadend = function (e) {
                                console.log('e.target.result',e.target.result)
                                var file = new Blob([e.target.result], {type: "image/jpeg"});
                                vm.addFile(file,img.imageId,img.imageName);
                                console.log('file',file)
                            };
                        }, function (e) {
                          console.log("fileEntry.file==="+JSON.stringify(e));
                        });
                    }, function (e) {
                          console.log("resolveLocalFileSystemURL==="+JSON.stringify(e));
                    });
                },

  • 相关阅读:
    python sys 模块
    python os 模块
    JS Dictionary
    JS Array
    JS String
    JS面向对象
    WPF中INotifyPropertyChanged用法与数据绑定
    JS的函数
    JS类型转换
    JS变量的作用域
  • 原文地址:https://www.cnblogs.com/mingbo-zhang/p/10239253.html
Copyright © 2011-2022 走看看