React axios request error 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);
      })

but still report an error

clipboard.png

Mar.22,2021

Cross-domain. The backend is configured


.

Learning link: https://cloud.tencent.com/dev.

personal suggestion: first, cross-domain requests are allowed on the server side.
spring version 4.2 and above can be annotated by CrossOrigin (reference: http://www.cnblogs.com/mmzs/p.)

Menu