大佬们帮忙看看什么问题 多谢!!
路过大神帮忙看看
有人吗
你这不光是HTTP请求失败,是越域了吧。
在你服务端加上:
app.all('*', function(req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With"); res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS"); res.header("X-Powered-By",' 3.2.1') if(req.method=="OPTIONS") res.send(200);/*让options请求快速返回*/ else next(); });
再请问一下,图片的链接我直接浏览器可以访问到,但是cc.loader.load访问不到,也是这个原因吗 多谢!
确实是跨域了
