I set up an environment locally, and then wanted to access the interface of the company's server. How to do it? You need to bring your login information and other status. How to use it can save more trouble.
I have tried writing it in configindex.js, but there are no cookies or anything. There is no return from the interface.
proxyTable: {
'/api': {
target: 'http://www.baidu.com/',
changeOrigin: true,
pathRewrite: {
'^/api': '/'
}
},
},
I don’t know how the status of your login information is stored. Currently we are trying jwt. You can search for this. The user’s basic information and expiration time are encrypted in the token and do not require storage on the server side. You can refer to the following.
If you are using axios
axios.defaults.withCredentials = true