mooho-base-admin-plus 0.1.49 → 0.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/mooho-base-admin-plus.min.esm.js +79092 -128297
  2. package/dist/mooho-base-admin-plus.min.js +49 -49
  3. package/dist/style.css +1 -1
  4. package/package.json +1 -1
  5. package/src/i18n/locale/en-US.js +1 -1
  6. package/src/i18n/locale/lang.js +1 -1
  7. package/src/i18n/locale/zh-CN.js +1 -1
  8. package/src/index.js +1 -1
  9. package/src/layouts/basic-layout/mixins/click-item.js +21 -21
  10. package/src/layouts/basic-layout/mixins/sider-menu-badge.js +13 -13
  11. package/src/layouts/basic-layout/mixins/translate-title.js +11 -11
  12. package/src/layouts/basic-layout/water-mark/index.vue +29 -29
  13. package/src/libs/random_str.js +10 -10
  14. package/src/libs/request/index.js +2 -2
  15. package/src/libs/water-mark.js +44 -44
  16. package/src/mixins/page.js +5 -2
  17. package/src/pages/account/login.vue +1 -2
  18. package/src/plugins/log/index.js +25 -0
  19. package/src/router/dynamic.js +1 -73
  20. package/src/router/index.js +96 -2
  21. package/src/store/modules/admin/modules/account.js +2 -2
  22. package/src/store/modules/admin/modules/db.js +6 -6
  23. package/src/store/modules/admin/modules/menu.js +2 -2
  24. package/src/store/modules/admin/modules/page.js +10 -10
  25. package/src/styles/common.less +47 -47
  26. package/src/styles/default/index.less +6 -6
  27. package/src/styles/font/demo.css +539 -539
  28. package/src/styles/font/demo_index.html +372 -372
  29. package/src/styles/font/icon-demo/demo.css +539 -539
  30. package/src/styles/font/icon-demo/demo_index.html +423 -423
  31. package/src/styles/font/icon-demo/iconfont.css +61 -61
  32. package/src/styles/font/icon-demo/iconfont.svg +59 -59
  33. package/src/styles/font/iconfont.css +47 -47
  34. package/src/styles/font/iconfont.json +65 -65
  35. package/src/styles/font/ionicons.svg +869 -869
  36. package/src/styles/index.less +7 -7
  37. package/src/styles/layout/basic-layout/layout.less +527 -527
  38. package/src/styles/layout/basic-layout/menu.less +274 -274
  39. package/src/styles/layout/index.less +2 -2
  40. package/src/styles/setting.less +6 -6
  41. package/test/main.js +2 -11
  42. package/vite.config.js +0 -1
  43. package/src/router/routerFactory.js +0 -84
@@ -1,84 +0,0 @@
1
- import { createRouter, createWebHistory, createWebHashHistory, createMemoryHistory } from 'vue-router';
2
- import ViewUIPlus from 'view-ui-plus';
3
- import util from '../libs/util';
4
- import Setting from '../setting';
5
- import store from '../store/index';
6
- import dynamic from './dynamic';
7
-
8
- const createMyRouter = base => {
9
- const router = createRouter({
10
- history: Setting.routerMode === 'history' ? createWebHistory(base) : setting.routerMode === 'hash' ? createWebHashHistory(base) : createMemoryHistory(base),
11
- routes: []
12
- });
13
-
14
- // 设置资源根目录
15
- Setting.rootPath = base == '' || base == null ? '/static/' : '/' + base + '/static/';
16
-
17
- // 是否初始化
18
- let inited = false;
19
-
20
- /**
21
- * 路由拦截
22
- * 权限验证
23
- */
24
-
25
- router.beforeEach(async (to, from, next) => {
26
- if (Setting.showProgressBar) {
27
- ViewUIPlus.LoadingBar.start();
28
- }
29
-
30
- if (!inited) {
31
- // 初始化动态路由
32
- let dynamicRoutes = await dynamic.init(router);
33
- let frameInRoutes = router.getRoutes();
34
-
35
- // 处理路由 得到每一级的路由设置
36
- store.commit('admin/page/init', [...frameInRoutes, ...dynamicRoutes]);
37
- inited = true;
38
- next({
39
- ...to,
40
- replace: true
41
- });
42
- } else {
43
- // 判断是否需要登录才可以进入
44
- if (to.matched.some(_ => _.meta.auth)) {
45
- // 这里依据 token 判断是否登录,可视情况修改
46
- const token = util.cookies.get('token');
47
-
48
- if (token && token !== 'undefined') {
49
- next();
50
- } else {
51
- // 没有登录的时候跳转到登录界面
52
- // 携带上登陆成功之后需要跳转的页面完整路径
53
- next({
54
- name: 'login',
55
- query: {
56
- redirect: to.fullPath
57
- }
58
- });
59
- }
60
- } else {
61
- // 不需要身份校验 直接通过
62
- next();
63
- }
64
- }
65
- });
66
-
67
- router.afterEach(to => {
68
- if (Setting.showProgressBar) ViewUIPlus.LoadingBar.finish();
69
- // 多页控制 打开新的页面
70
- if (!('meta' in to) || (to.meta && !('tabs' in to.meta)) || (to.meta && to.meta.tabs)) {
71
- store.dispatch('admin/page/open', to);
72
- }
73
- // 更改标题
74
- util.title({
75
- title: to.meta.title
76
- });
77
- // 返回页面顶端
78
- window.scrollTo(0, 0);
79
- });
80
-
81
- return router;
82
- };
83
-
84
- export default createMyRouter;