Axios cross-domain problem

is very distressing, and everything that has been rewritten has been written. It has always been localhost

.

another project has also been restarted

main.js

created() {
    let url = this.HOST + "/query";
    this.$axios.get(url, {
      params:{
        type: "yunda",
        postid: 3916090104344
      }
    })
    .then(res => {
      console.log(res);
    })
    .catch(error => {
      console.log(error)
    })

  }
Feb.28,2021

1. This is not a cross-domain problem. You enable the http-proxy component to delegate your request to the domain name http://www.kuaidi100.com. What you see in the browser is localhost, but you actually visit http://www.kuaidi100.com
2.. As for why it is 404, one case is that there is no corresponding interface in the background, and the other is that pathRewrite is not configured correctly


api should be written as / api, because you want to represent / api

proxyTable: {
  '/api':{
    target:'http://www.kuaidi100.com',
    changeOrigin:true,
    pathRewrite:{
      '^/api':''
    }
  }
},
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b30db9-2bd44.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b30db9-2bd44.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?