我想用axios做一个请求,但是报错如下,No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8085' is therefore not allowed access. The response had HTTP status code 405.然后我用jquery的方法请求了一次,没有报错,不明白axios请求为啥报错,因为是基于vue环境,所以也是第一次尝试用axios请求,希望路过的各位大神指点一下 axios({ method: 'get', url: 'http://123.55.94.183:8091/apifit/transfer/transfer', responseType: 'json', data: PostJson({ fitUserId: 'belle', reqTransfer: '/apifit/medal/getUser' }) }) .then(function (response) { console.log(response) }) .catch(function (error) { console.log(error) })
添加回答
举报
0/150
提交
取消
