main.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. //////////模拟传入参数
  28. const username = 'aiyu6'
  29. /////////////////
  30. // 在跳入路由之前要请求获取权限信息
  31. router.beforeEach(async (to, from, next) => {
  32. if (!store.state.isrequestAuth) {
  33. await store.dispatch('getUserInfo', username)
  34. await store.dispatch('getFloors')
  35. }
  36. next()
  37. })
  38. new Vue({
  39. router,
  40. store,
  41. render: (h) => h(App),
  42. }).$mount('#app')