Install axios: npm install axios
Reintroduced into the configuration in FIG. Main.js in:
import axios from 'axios'
Vue.prototype. $ Ajax = axios
// axios Configuration
axios.defaults.timeout = 5000;
//axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';
// axios.defaults.headers.post['Content-Type'] = 'json';
// axios.defaults.baseURL = 'http: // localhost: 8080 / project name /';
axios.defaults.baseURL = 'http://localhost:3682/';
vue Add code page:
Renderings:
Java backend interfaces:
Vue run the project, call interface