npm install axios --save
// 引入axios,并加到原型链中
import Axios from 'axios'
Axios.defaults.withCredentials=true;
Axios.defaults.baseURL='http://url'
Vue.prototype.$http = Axios
created() {
//var openId = localStorage.getItem("openId");
this.$http
.get("/app/login/autoLogin?openId="+openId)
.then(res => {
console.log(res.data);
this.myDetail = res.data;
});
},
网友评论