How to solve the cross domain problem of Axios in Vue project

first step, configure BaseUrl:
. In main.js, configure the Url we visit with the prefix: axios.defaults. BaseUrl = ‘/ API’ // develop the local agent;
second step, configure the agent:
modify the index.js file under config folder, add relevant code in proxyTable:
third step, modify the request URL:
this.$axios.get(“/test/test123”). { console.log(res) }) .catch(err=> { console.log(err) })

Read More: