main.js 881 B

123456789101112131415161718192021222324252627282930
  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 host from '../src/request/host'
  11. // import {get,post} from './service/http'
  12. Vue.use(Cube)
  13. // 修改请求接口(删掉地址栏中的app2)
  14. let domainName = document.domain;//域名
  15. let protocolName = document.location.protocol;//http协议
  16. axios.defaults.baseURL=protocolName + '//' + domainName;
  17. // axios.defaults.timeout = 5000;
  18. Vue.prototype.$http= axios
  19. Vue.config.productionTip = false
  20. Vue.prototype.$host = protocolName + '//' + domainName;
  21. /* eslint-disable no-new */
  22. new Vue({
  23. el: '#app',
  24. router,
  25. components: { App },
  26. template: '<App/>'
  27. })