main.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 store from './store';
  7. import ElementUI from 'element-ui';
  8. import frce from '../static/frce';
  9. import http from './api/http';
  10. // import publicMethods from '../static/publicMethods';
  11. import 'element-ui/lib/theme-chalk/index.css';
  12. import axios from 'axios'; //引入axios
  13. import ports from './api/ports.js'; //api接口文档
  14. import publicMethods from '../static/publicMethods.js';
  15. import md5 from 'js-md5';
  16. Vue.use(ElementUI);
  17. axios.defaults.headers.post['Content-Type'] = 'Content-Type: application/json';
  18. // post请求头
  19. axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
  20. Vue.config.productionTip = false;
  21. // 注册表情包数组
  22. Vue.prototype.$frce = frce.frce;
  23. // 注册加密文档
  24. Vue.prototype.$md5 = md5;
  25. // 公共方法
  26. Vue.prototype.$ports = ports;
  27. Vue.prototype.$http = http;
  28. Vue.prototype.post = axios.post;
  29. Vue.prototype.get = axios.get;
  30. Vue.prototype.$public = publicMethods;
  31. /* eslint-disable no-new */
  32. new Vue({
  33. el: '#app',
  34. router,
  35. store,
  36. components: {
  37. App
  38. },
  39. template: '<App/>'
  40. })