main.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // The Vue build version to load with the `import` command
  2. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
  3. import Vue from "vue";
  4. import App from "./App";
  5. import router from "./router";
  6. import axios from "axios";
  7. import Cube from "./index";
  8. import "lib-flexible";
  9. import "./filters";
  10. // import VConsole from "vconsole";
  11. // import host from '../src/request/host'
  12. // import {get,post} from './service/http'
  13. // new VConsole();
  14. Vue.use(Cube);
  15. // 修改请求接口(删掉地址栏中的app2)
  16. let domainName = document.domain; //域名
  17. let protocolName = document.location.protocol; //http协议
  18. axios.defaults.baseURL = protocolName + "//" + domainName;
  19. // axios.defaults.timeout = 5000;
  20. Vue.prototype.$http = axios;
  21. Vue.config.productionTip = false;
  22. Vue.prototype.$host = protocolName + "//" + domainName;
  23. Vue.prototype.$baseURL = protocolName + "//" + domainName;
  24. //因项目众多,前端为了加以区分,所以用域名加以判断,后期有更好的方式可以自行修改
  25. // 中南财大
  26. Vue.prototype.isZncd = document.domain === 'itsm.zuel.edu.cn';
  27. /* eslint-disable no-new */
  28. new Vue({
  29. el: "#app",
  30. router,
  31. components: { App },
  32. template: "<App/>"
  33. });