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:
- Solution to cross domain sharing problem of session
- Encapsulation of Axios and management of API interface in Vue
- Ajax error reporting cross domain, AJAX cross domain access error 501 solution
- Chrome setting — Disable web security to solve cross domain problems
- Vue uses Axios
- How to solve the problem that the project module turns grey in Maven
- Solve the problem of “error empty block statement no empty” in the console (Vue project)
- If the iframe in IE refers to the cross domain site page, the session fails
- Solution of Vue axios400 bad request problem
- The problem that headers [‘content-type ‘] does not work is set in the Axios get method request interface
- Solved: No’Access-Control-Allow-Origin’ cross-domain issue
- How to solve the problem of artifact contains illegal characters when creating springboot project with idea
- Springboot plus cross domain annotation @crossorigin startup error
- Flash + Vue uses Axios to obtain server data, and reports error: “request aborted”
- The spring boot project was first created, pom.xml The error is Maven configuration problem. How to solve it?
- How to Solve Vue Command Not Work Issue in win7_64
- To solve the problem in Windows opencv installation: error configuration process, project files may be invalid
- How to solve the problem that the console window disappears in a flash after visual studio 2017 runs
- Domain error in object XXX “other” domain “other” rejected values and atm913
- How to solve the problem of “blocked loading mixed active content” in Firefox