有解决方案吗?我用微信的图片选择器返回的url,真机调试出错readFileSync:fail timeout,机型华为P20pro
FileSystemManager 读取大文件超时?小程序真机调试时,下载大约5MB的文件后,读取超时。试过两种方法: 方法一:FileSystemManager.readFile(Object object) var wasmfilepath = evt.tempFilePath; console.log(wasmfilepath) console.log(wasmdir + wasmfilename) var ret = FSM.saveFileSync(wasmfilepath, wasmdir + wasmfilename); console.log(ret) var stat = FSM.statSync(ret, false) console.log(stat) FSM.readFile({filePath: ret, success(res) { console.log("read file suceed!!!") new WebAssembly.compile(wasmdata).then(function (wam) { new WebAssembly.instantiate(wam, info).then(receiveInstantiatedSource); }); }, fail: console.error }); 方法二:FileSystemManager.readFile(Object object) var wasmfilepath = evt.tempFilePath; console.log(wasmfilepath) console.log(wasmdir + wasmfilename) var ret = FSM.saveFileSync(wasmfilepath, wasmdir + wasmfilename); console.log(ret) var stat = FSM.statSync(ret, false) console.log(stat) var res = FSM.readFileSync(ret) new WebAssembly.compile(res).then(function (wam) { new WebAssembly.instantiate(wam, info).then(receiveInstantiatedSource); });[图片] 模拟器调试同样的代码,没有问题。
2021-12-31