From ceef20384a539593f337faa278ca896406d0d284 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Thu, 16 Nov 2017 11:38:00 +0800 Subject: [PATCH] Remove text downloader polyfill for wechat game --- cocos2d/core/load-pipeline/text-downloader.js | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/cocos2d/core/load-pipeline/text-downloader.js b/cocos2d/core/load-pipeline/text-downloader.js index 2f997e658d..39ac5a3e7e 100644 --- a/cocos2d/core/load-pipeline/text-downloader.js +++ b/cocos2d/core/load-pipeline/text-downloader.js @@ -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;