baseurl的地址可问后端要
2.项目中请求的时候怎么加上baseurl?
设置一个全局的拦截,在全局拦截中加入的
Vue.use(Resource); Vue.http.options.emulateJSON = true; Vue.http.options.credentials = true; Vue.http.options.root = API_URL; Vue.http.interceptors.push(function(request, next) { next(function(response) { //未登录被拦截 if (response.data.code === "000") { localStorage.setItem('gotourl', window.location.href);//存到本地,登录后,再跳到此页面 window.location.href = '/login.html'; } }); });
3.nginx配置的反向代理中,具体的运行机制到底是如何进行的?