this.data.src = "wxfile://tmp_20f3b439b28c3bxxxxxxxxxxxxxxxxxxxx.jpg"; // 在代码中该地址是正常的微信临时文件路径
let base = wx.getFileSystemManager().readFileSync(this.data.src, 'base64');
console.log(base)
这一段代码,在安卓上没任何问题,可以转成base64,但在ios上就报错,提示超时了,如下:
[publib]:1 thirdScriptError
readFileSync:fail timeout;at pages/auth/auth page getBaseImg function
Error: readFileSync:fail timeout
at readFileSync ([publib]:1:432687)
at Object.e.(anonymous function) [as readFileSync] ([publib]:1:438711)
at s.getBaseImg (weapp:///pages/auth/auth.js:62:42)
at s.
([publib]:1:966027)
at Function.success (weapp:///pages/auth/auth.js:29:14)
at Object.success ([publib]:1:101885)
at v ([publib]:1:212131)
at v ([publib]:1:212317)
at [publib]:1:213673
at Object.y ([publib]:1:1375)
到底啥情况?
微信小程序开发问题解答
微信小程序开发者回答:
别说什么提供代码片段的废话,说了等于没说
本文网址:http://www.91bianli.com/weixinxiaochengxu/5675.html