vue project has always been modified and modified on the existing basis. Now a new project has started, and it has been found that domain name proxy configuration and cross-domain problems have not been solved. Under the explanation of God, many online code methods have been tried or failed. The details are as follows:
1, the interface given by the backend is as follows: http://conference-beta.mamaqunaer.com/v1/admin
2, local opening is localhost:8080
;
3, change url: div.sale.mamaqunaer.com
with ngix, and you can open the local area normally.
4, then configure index.js, under config to write under dev:
`proxyTable: {
"/api": {
target: "http://conference-beta.mamaqunaer.com",
changeOrigin: true,
pathRewrite: {
"^/api": ""
}
}
},
`
. After opening the page, the API reports an error:
I don"t know what"s wrong