[LayaAir 2.0]laya2.0 http 发送请求跨域报错
这边用原生xmlhttprequest发送请求正常,用laya.httprequest 发送请求报错。
Access to XMLHttpRequest at 'file:///C:\Users\pc\AppData\Roaming\Tencent\QQ\Temp\%W@GJ$ACOF(TYDYECOKVDYB.pnghttp://gs.mingdikeji.com/passion//system/getVersion' from origin 'file:///C:\Users\pc\AppData\Roaming\Tencent\QQ\Temp\%W@GJ$ACOF(TYDYECOKVDYB.pnghttp://192.168.50.231:8900' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
在电脑上运行都没问题,在手机上就报错。电脑上出现了不了这个问题。
Access to XMLHttpRequest at 'file:///C:\Users\pc\AppData\Roaming\Tencent\QQ\Temp\%W@GJ$ACOF(TYDYECOKVDYB.pnghttp://gs.mingdikeji.com/passion//system/getVersion' from origin 'file:///C:\Users\pc\AppData\Roaming\Tencent\QQ\Temp\%W@GJ$ACOF(TYDYECOKVDYB.pnghttp://192.168.50.231:8900' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
在电脑上运行都没问题,在手机上就报错。电脑上出现了不了这个问题。
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
虫虫
赞同来自: