main.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3. return new (P || (P = Promise))(function (resolve, reject) {
  4. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8. });
  9. };
  10. import Vue from 'vue';
  11. import App from './App.vue';
  12. import router from './router';
  13. import store from './store';
  14. Vue.config.productionTip = false;
  15. import design from 'ant-design-vue';
  16. import 'ant-design-vue/dist/antd.css';
  17. Vue.use(design);
  18. import ElementUI from 'element-ui';
  19. import 'element-ui/lib/theme-chalk/index.css';
  20. Vue.use(ElementUI);
  21. import VueQuillEditor from 'vue-quill-editor';
  22. import 'quill/dist/quill.core.css';
  23. import 'quill/dist/quill.snow.css';
  24. import 'quill/dist/quill.bubble.css';
  25. Vue.use(VueQuillEditor);
  26. import WdEditor from '@/components/Editor';
  27. Vue.use(WdEditor);
  28. import Rotation from '@/components/Rotation';
  29. Vue.use(Rotation);
  30. import PicLarge from '@/components/PicLarge';
  31. Vue.use(PicLarge);
  32. import Legend from '@/components/Legend';
  33. Vue.use(Legend);
  34. import cookies from 'vue-cookie';
  35. Vue.use(cookies);
  36. import Pui from 'meri-design';
  37. import 'meri-design/dist/index.css';
  38. Vue.use(Pui);
  39. //////////模拟传入参数
  40. const username = 'lengqiang';
  41. /////////////////
  42. // 在跳入路由之前要请求获取权限信息
  43. router.beforeEach((to, from, next) => __awaiter(void 0, void 0, void 0, function* () {
  44. if (!store.state.isrequestAuth) {
  45. yield store.dispatch('getUserInfo', username);
  46. yield store.dispatch('getFloors');
  47. }
  48. next();
  49. }));
  50. new Vue({
  51. router,
  52. store,
  53. render: (h) => h(App),
  54. }).$mount('#app');