我之前发布了一个WCF服务到服务器,然后自己写了一个index.html网页,在网页中通过axios请求wcf数据。然后就出现两个问题:
1、 OPTIONS http://39.115.99.19/dataService.svc/GetData (anonymous function) @ axios.min.js:8e.exports @
.min.js:8e.exports @ axios.min.js:8
2、 XMLHttpRequest cannot load http://39.115.99.19/dataService.svc/GetData. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 405.
后来搜索是跨域问题,求解决