main.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * @Author: FS
  3. * @Date: 2024-01-01 09:00:00
  4. * @Description: 代理端管理系统入口文件
  5. */
  6. import Vue from 'vue'
  7. import Cookies from 'js-cookie'
  8. import Element from 'element-ui'
  9. import './assets/styles/element-variables.scss'
  10. import '@/assets/styles/index.scss' // global css
  11. import '@/assets/styles/common.scss'
  12. import App from './App'
  13. import store from './store'
  14. import router from './router'
  15. import './permission' // permission control
  16. import VueMeta from 'vue-meta'
  17. import * as echarts from "echarts";
  18. import logImgDefault from '@/assets/images/profile.jpg'
  19. // 全局方法挂载
  20. Vue.prototype.logImg = process.env.VUE_APP_LOG_URL || logImgDefault
  21. Vue.prototype.echarts = echarts
  22. Vue.prototype.msgSuccess = function (msg) {
  23. this.$message({ showClose: true, message: msg, type: "success" });
  24. }
  25. Vue.prototype.msgError = function (msg) {
  26. this.$message({ showClose: true, message: msg, type: "error" });
  27. }
  28. Vue.prototype.msgInfo = function (msg) {
  29. this.$message.info(msg);
  30. }
  31. Vue.use(VueMeta)
  32. /**
  33. * If you don't want to use mock-server
  34. * you want to use MockJs for mock api
  35. * you can execute: mockXHR()
  36. *
  37. * Currently MockJs will be used in the production environment,
  38. * please remove it before going online! ! !
  39. */
  40. Vue.use(Element, {
  41. size: Cookies.get('size') || 'medium' // set element-ui default size
  42. })
  43. Vue.config.productionTip = false
  44. async function bootstrap() {
  45. new Vue({
  46. el: '#app',
  47. router,
  48. store,
  49. render: h => h(App)
  50. })
  51. }
  52. bootstrap()