在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ axios請求報錯405

axios請求報錯405

我想用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環(huán)境,所以也是第一次嘗試用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)
    })
回答
編輯回答
墻頭草

No 'Access-Control-Allow-Origin' header is present on the requested resource.

跨域請求錯誤,要后端將響應頭Access-Control-Allow-Origin設置成*就好了

2017年12月20日 20:57
編輯回答
萢萢糖

405是請求類型錯誤吧,你看看是不是后端不支持get方式的請求

2018年8月6日 12:14