main.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. import router from './router'
  4. import store from './store'
  5. Vue.config.productionTip = false
  6. import design from 'ant-design-vue'
  7. import 'ant-design-vue/dist/antd.css'
  8. Vue.use(design)
  9. import ElementUI from 'element-ui'
  10. import 'element-ui/lib/theme-chalk/index.css'
  11. Vue.use(ElementUI)
  12. import VueQuillEditor from 'vue-quill-editor'
  13. import 'quill/dist/quill.core.css'
  14. import 'quill/dist/quill.snow.css'
  15. import 'quill/dist/quill.bubble.css'
  16. Vue.use(VueQuillEditor)
  17. import WdEditor from '@/components/Editor'
  18. Vue.use(WdEditor)
  19. import Rotation from '@/components/Rotation'
  20. Vue.use(Rotation)
  21. import PicLarge from '@/components/PicLarge'
  22. Vue.use(PicLarge)
  23. import Legend from '@/components/Legend'
  24. Vue.use(Legend)
  25. import cookies from 'vue-cookie'
  26. Vue.use(cookies)
  27. import Pui from 'meri-design'
  28. import 'meri-design/dist/index.css'
  29. Vue.use(Pui)
  30. //////////模拟传入参数
  31. const username = 'lengqiang'
  32. /////////////////
  33. // 在跳入路由之前要请求获取权限信息
  34. router.beforeEach(async (to, from, next) => {
  35. if (!store.state.isrequestAuth) {
  36. await store.dispatch('getUserInfo', username)
  37. await store.dispatch('getFloors')
  38. }
  39. next()
  40. })
  41. new Vue({
  42. router,
  43. store,
  44. render: (h) => h(App),
  45. }).$mount('#app')