Vue.prototype.$http = axios;
Vue.config.productionTip = false;

Vue.prototype.$event = new Vue();

/* eslint-disable no-new */
var init = function() {
  new Vue({
    el: "#app",
    router,
    store,
    template: "<App/>",
    render: h => h(App)
  });
};
//这里根据单页面name的指向不同,去访问的接口域名也不同
router.beforeResolve((to, from, next) => {
  let url;
  if (
    to.matched[0].name == "broker-shop" ||
    to.matched[0].name == "information"
  ) {
    url = "https://ddd.zhaoshang800.com";
  } else if (to.matched[0].name == "brokerage-list") {
    url = "https://aaa.zhaoshang800.com";
  } else if (to.matched[0].name == "sellhot") {
    url = "https://bbb.zhaoshang800.com";
  } else if (to.matched[0].name == "enterprise-index") {
    url = "http://ccc.zhaoshang800.com";
  } else {
    url = "https://" + location.host;
  }
  Vue.prototype.$http.defaults.baseURL = url;
  next();
});

 

Logo

前往低代码交流专区

更多推荐