1, man of few words said, directly Code
The root directory is created vue.config.js
module.exports = {
devServer: {
port: 3000, // port
proxy: {
'/api': {
target: 'http://192.168.9.217:8999/',
changeOrigin: true,
ws: true,
Pthriawrite: {
'^/api': ''
}
}
}
},
// lintOnSave: false // cancel eslint verification
}
axios post parameter passing problem
methods:{
getParent(){
console.log(this.input);
const params = new URLSearchParams();
params.append('name', this.input);
params.append('password', this.input1);
this.$axios.post('api/user/login',params)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
}
},
About axios post request mass participation details of the problem