Remove text downloader polyfill for wechat game

This commit is contained in:
pandamicro
2017-11-16 11:38:00 +08:00
parent fc1a6dd25b
commit ceef20384a
@@ -18,35 +18,8 @@ else {
module.exports = function (item, callback) {
var url = item.url;
url = urlAppendTimestamp(url);
if (sys.platform === sys.WECHAT_GAME) {
var fs = wx.getFileSystemManager();
var filePath = url;
// var localPath = wx.env.USER_DATA_PATH + '/' + filePath;
// Read from package
// fs.accessSync(filePath);
fs.readFile({
filePath: filePath,
encoding: 'utf8',
success: function (res) {
if (res.data) {
// console.error('read file success');
callback(null, res.data);
}
},
fail: function (res) {
if (res.errMsg) {
console.error('read file path' + filePath + ' failed!');
cc.game.emit('xhr-load-error:', res.errMsg);
callback({status:0, errorMessage: res.errMsg});
}
}
});
return;
}
var xhr = cc.loader.getXMLHttpRequest(),
errInfo = 'Load ' + url + ' failed!',
navigator = window.navigator;