鍍金池/ 問答/HTML/ react axios 請求報錯 No 'Access-Control-Allo

react axios 請求報錯 No 'Access-Control-Allow-Origin'

    axios.defaults.withCredentials = true
    axios.defaults.baseURL = '//192.168.10.93:8088/'
    axios.post('/channel/insert.html', {name: '1', domain: '2', type: 0}, {
        headers: {
          "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
          "Access-Control-Allow-Origin": "*",
        }
      })
      .then(response => {
        console.log(response)
      }, err => {
        console.log(err);
      })
      .catch((error) => {
        console.log(error);
      })

但還是會報錯

clipboard.png

回答
編輯回答
心夠野

跨域了,后端配置一下

2018年5月19日 23:35