碰到个郁闷的问题,用cocos-js做的h5游戏,是通过xhr异步加载的mp3之类的游戏资源。本来也挺正常,突然,发现部分资源被本地的ISP(杭州华数)给劫持到了他们自己的缓存服务器上。
原本:
http://catshop.coding.io/game/res/audio/effect_cat_sold_fall.mp3
302重定向到了:
http://218.108.192.233/1Q2W3E4R5T6Y7U8I9O0P1Z2X3C4V5B/catshop.coding.io/game/res/audio/effect_cat_sold_fall.mp3
然后,我就晕了,浏览器直接报了:
No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://catshop.coding.io’ is therefore not allowed access.
跨域的错误了。大家有什么办法吗?