大致代码如下:
var TxGame = {funcEnable:{}};
window.TxGame = TxGame;
TxGame.env = wx.env;
TxGame.fs = wx.getFileSystemManager();
TxGame.access = TxGame.fs.access;
TxGame.mkdirSync = TxGame.fs.mkdirSync;
WeiXinFileManager.LAYA_DOC = "/layaairGame/";
var M = WeiXinFileManager;
M.USE_DOC = TxGame.env.USER_DATA_PATH;
M.LAYA_DOC = TxGame.env.USER_DATA_PATH + M.LAYA_DOC;
M.TX_FILE_LIST = M.LAYA_DOC + M.TX_FILE_LIST;
this.fileListLoad = false;
TxGame.access({ path: M.LAYA_DOC, success: function () {
console.log("文件夹存在:" + WeiXinFileManager.LAYA_DOC);
// WeiXinFileManager.getIns().scanFiles();
var me = M.getIns();
me.loadFileList();
Laya.timer.frameLoop(1, me, me.onFrameUpdate);
}, fail: function (data) {
console.warn(data.errMsg);
var me = M.getIns();
var result = TxGame.mkdirSync(M.LAYA_DOC, false);
if (result)
console.error(result.errMsg);
else {
console.log("文件创建完成:" + M.LAYA_DOC);
me.fileListLoad = true;
me.downNext();
Laya.timer.frameLoop(1, me, me.onFrameUpdate);
} });
以前没有出现报错,26号微信后台开始出现报错。
mkdirSync:fail no such file or directory "wxfile://usr/layaairGame/";at api access fail callback function
Error: mkdirSync:fail no such file or directory "wxfile://usr/layaairGame/"
at mkdirSync (https://lib/WAGame.js:2:677712)
at Object.e.<computed> (https://lib/WAGame.js:2:681863)
at Object.fail (https://lib/WAGame.js:2:486409)
at v (https://lib/WAGame.js:2:494046)
at https://lib/WAGame.js:2:495205
at Object.g (https://lib/WAGame.js:2:72747)
mkdirSync:fail no such file or directory "wxfile://usr/layaairGame/";at api access fail callback function
mkdirSync:fail no such file or directory "wxfile://usr/layaairGame/";at api access fail callback function
Error: mkdirSync:fail no such file or directory "wxfile://usr/layaairGame/"
at mkdirSync (https://lib/WAGame.js:1:545870)
at Object.e.(anonymous function) (https://lib/WAGame.js:1:550148)
at Object.f.(anonymous function) (https://lib/WAGame.js:1:1104257)
at RO (https://lib/WAGame.js:1:1102733)
at Function.fail (https://lib/WAGame.js:1:1104449)
at Object.fail (https://lib/WAGame.js:1:425074)
at https://lib/WAGame.js:1:431884
at v (https://lib/WAGame.js:1:432053)
at https://lib/WAGame.js:1:432917
at Object.v (https://lib/WAGame.js:1:1447)
请问是什么原因导致出现的此问题,无法复现
麻烦提供下appid和使用的基础库版本。
设置的线上基础库是2.2.0