错误提示:
Access to XMLHttpRequest at ‘http://192.168.1.111:5557/acount/UserLoginForWap’ from origin ‘http://192.168.1.111:8080’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.
经过一番挣扎,最终妥协,通过vs2017创建 webapi 来提供给uni-app访问,同时配置了跨域访问操作.
关键字搜索 asp.net webapi跨域
//跨域配置
config.EnableCors(new System.Web.Http.Cors.EnableCorsAttribute("http://192.168.1.111:5557,http://192.168.1.111:8080", "*", "*"));
版权声明:本文为sunwork888原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。