Cross-domain is achieved by configuring peoxyTable, but the browser reported an error of 404
configuration of proxyTable
dev: {
env: require("./dev.env"),
autoOpenBrowser: true,
assetsSubDirectory: "static",
assetsPublicPath: "/",
proxyTable: {
"/api": {
target: "http://172.16.2.207:8765",
changeOrigin: true,
pathRewrite: {
"^/api": "/"
}
}
},
request
this.$axios({
method: "post",
baseURL: "/api",
url: "/uaa/oauth/token",
data: {
"scope": "openid",
"grant_type": "password",
"username": this.loginForm.user_name,
"password": this.loginForm.pass
},
params: param,
headers: {
"Authorization": "Basic " + btoa(username+":"+password),
"Content-Type":"application/x-www-form-urlencoded",
"X-Requested-With": "XMLHttpRequest"
},
withCredentials:true,
transformRequest: [data => {
return qs.stringify(data);
}],
paramsSerializer: function(params) {
return qs.stringify(params, {arrayFormat: "brackets"})
},
auth: {
username: username,
password: password
},
})
.then(request => {
console.log(1);
})
.then(response => {
console.log(2)
})
browser error
what is the reason for this?