mooho-base-admin-plus 0.1.48 → 0.1.51
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.
- package/.env +1 -1
- package/dist/mooho-base-admin-plus.min.esm.js +73118 -122255
- package/dist/mooho-base-admin-plus.min.js +46 -46
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/index.js +5 -24
- package/src/libs/request/index.js +2 -3
- package/src/mixins/page.js +5 -2
- package/src/pages/account/login.vue +1 -2
- package/src/router/dynamic.js +1 -4
- package/src/router/index.js +75 -67
- package/src/setting.js +2 -2
- package/src/store/modules/admin/modules/account.js +2 -2
- package/src/store/modules/admin/modules/db.js +6 -6
- package/src/store/modules/admin/modules/menu.js +2 -2
- package/src/store/modules/admin/modules/page.js +10 -10
- package/test/main.js +5 -9
- package/vite.config.js +0 -1
- package/.envpr +0 -4
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mooho-base-admin-plus",
|
|
3
3
|
"description": "MOOHO basic framework for admin by Vue3",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.51",
|
|
5
5
|
"author": "jinyifan <jinyifan@mooho.com.cn>",
|
|
6
6
|
"dotnetVersion": "1.3.97",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"private": false,
|
|
9
|
-
"main": "./dist/mooho-base-admin-plus.min.js",
|
|
9
|
+
"main": "./dist/mooho-base-admin-plus.min.esm.js",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "vite --open",
|
|
12
12
|
"build": "vite build",
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
//import '@babel/polyfill';
|
|
2
2
|
|
|
3
3
|
// Vue
|
|
4
|
-
import { createApp, h, getCurrentInstance } from 'vue';
|
|
5
4
|
import App from './App.vue';
|
|
6
5
|
|
|
7
6
|
// 设置
|
|
@@ -20,14 +19,16 @@ import store from './store';
|
|
|
20
19
|
// ViewUIPlus
|
|
21
20
|
import ViewUIPlus from 'view-ui-plus';
|
|
22
21
|
|
|
23
|
-
//
|
|
24
|
-
import router from './router';
|
|
22
|
+
// 菜单
|
|
25
23
|
import menuHeader from './menu/header';
|
|
26
24
|
//import menuSider from './menu/sider';
|
|
27
25
|
|
|
28
26
|
// 多语言
|
|
29
27
|
import i18n from './i18n';
|
|
30
28
|
|
|
29
|
+
// 路由工厂
|
|
30
|
+
import { createRouter } from './router';
|
|
31
|
+
|
|
31
32
|
// 方法
|
|
32
33
|
//import { getHeaderName, getMenuSider, getSiderSubmenu } from './libs/system';
|
|
33
34
|
|
|
@@ -196,24 +197,4 @@ const routeChanged = to => {
|
|
|
196
197
|
|
|
197
198
|
export default API;
|
|
198
199
|
|
|
199
|
-
export {
|
|
200
|
-
pages,
|
|
201
|
-
createApp,
|
|
202
|
-
h,
|
|
203
|
-
getCurrentInstance,
|
|
204
|
-
App,
|
|
205
|
-
router,
|
|
206
|
-
store,
|
|
207
|
-
i18n,
|
|
208
|
-
setting,
|
|
209
|
-
basicLayout,
|
|
210
|
-
lodop,
|
|
211
|
-
request,
|
|
212
|
-
mixinPage,
|
|
213
|
-
modelApi,
|
|
214
|
-
dataSourceApi,
|
|
215
|
-
taskApi,
|
|
216
|
-
util,
|
|
217
|
-
created,
|
|
218
|
-
routeChanged
|
|
219
|
-
};
|
|
200
|
+
export { pages, App, store, i18n, setting, basicLayout, lodop, request, mixinPage, modelApi, dataSourceApi, taskApi, util, createRouter, created, routeChanged };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import store from '../../store';
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
import util from '../util';
|
|
4
|
-
import
|
|
4
|
+
import { getRouter } from '../../router';
|
|
5
5
|
import swal from 'sweetalert2';
|
|
6
6
|
import Setting from '../../setting';
|
|
7
7
|
|
|
@@ -29,7 +29,6 @@ function errorLog(err) {
|
|
|
29
29
|
util.log.error('>>>>>> Error >>>>>>');
|
|
30
30
|
console.log(err);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
32
|
swal.fire({
|
|
34
33
|
title: err.message,
|
|
35
34
|
icon: 'error',
|
|
@@ -108,7 +107,7 @@ service.interceptors.response.use(
|
|
|
108
107
|
},
|
|
109
108
|
error => {
|
|
110
109
|
if (error && error.response && error.response.status === 401) {
|
|
111
|
-
|
|
110
|
+
getRouter().push('/login?redirect=' + getRouter().history._startLocation);
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
store.commit('admin/loader/end');
|
package/src/mixins/page.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import util from '../libs/util';
|
|
2
|
-
import
|
|
2
|
+
import { getRouter } from '../router';
|
|
3
3
|
import { mapState, mapActions } from 'vuex';
|
|
4
4
|
import dateFormat from 'date-fns/format';
|
|
5
5
|
import Setting from '../setting';
|
|
@@ -72,6 +72,9 @@ export default {
|
|
|
72
72
|
...mapState('admin/user', ['info']),
|
|
73
73
|
...mapState('admin/cache', ['userNames', 'enums', 'dicts', 'caches']),
|
|
74
74
|
...mapState('admin/menu', ['userPermissions']),
|
|
75
|
+
router() {
|
|
76
|
+
return getRouter();
|
|
77
|
+
},
|
|
75
78
|
rootPath() {
|
|
76
79
|
return Setting.rootPath;
|
|
77
80
|
},
|
|
@@ -106,7 +109,7 @@ export default {
|
|
|
106
109
|
} else {
|
|
107
110
|
// 页面权限点
|
|
108
111
|
//console.log('router.currentRoute', router.currentRoute.value.fullPath);
|
|
109
|
-
let url =
|
|
112
|
+
let url = getRouter().currentRoute.value.fullPath.substr(1);
|
|
110
113
|
|
|
111
114
|
if (this.userPermissions[url + '$' + key] == true) {
|
|
112
115
|
return true;
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
<script>
|
|
27
27
|
import { mapActions } from 'vuex';
|
|
28
|
-
import router from '../../router';
|
|
29
28
|
import mixinPage from '../../mixins/page';
|
|
30
29
|
//import permissionApi from '../../api/permission';
|
|
31
30
|
|
|
@@ -84,7 +83,7 @@
|
|
|
84
83
|
|
|
85
84
|
// 重定向对象不存在则返回顶层路径
|
|
86
85
|
setTimeout(() => {
|
|
87
|
-
router.replace(this.$route.query.redirect || '/home');
|
|
86
|
+
this.router.replace(this.$route.query.redirect || '/home');
|
|
88
87
|
});
|
|
89
88
|
}
|
|
90
89
|
},
|
package/src/router/dynamic.js
CHANGED
|
@@ -2,10 +2,7 @@ import permissionApi from '../api/permission';
|
|
|
2
2
|
|
|
3
3
|
// 动态路由
|
|
4
4
|
export default {
|
|
5
|
-
async init(router) {
|
|
6
|
-
let pages = router.pages;
|
|
7
|
-
let layout = router.layout;
|
|
8
|
-
|
|
5
|
+
async init(router, pages, layout) {
|
|
9
6
|
let res = await permissionApi.queryRouter();
|
|
10
7
|
|
|
11
8
|
// 自定义页面数据处理
|
package/src/router/index.js
CHANGED
|
@@ -5,85 +5,93 @@ import Setting from '../setting';
|
|
|
5
5
|
import store from '../store/index';
|
|
6
6
|
import dynamic from './dynamic';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
console.log('window.$env', window.$env);
|
|
8
|
+
var router;
|
|
10
9
|
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
// 创建路由
|
|
11
|
+
const create = (base, pages, layout, routes) => {
|
|
12
|
+
router = createRouter({
|
|
13
|
+
history: Setting.routerMode === 'history' ? createWebHistory(base) : Setting.routerMode === 'hash' ? createWebHashHistory(base) : createMemoryHistory(base),
|
|
14
|
+
routes: []
|
|
15
|
+
});
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
// 添加静态路由
|
|
18
|
+
routes.forEach(route => {
|
|
19
|
+
router.addRoute(route);
|
|
20
|
+
});
|
|
18
21
|
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
history: Setting.routerMode === 'history' ? createWebHistory(base) : Setting.routerMode === 'hash' ? createWebHashHistory(base) : createMemoryHistory(base),
|
|
22
|
-
routes: []
|
|
23
|
-
});
|
|
22
|
+
// 设置资源根目录
|
|
23
|
+
Setting.rootPath = base == '' || base == null ? '/static/' : '/' + base + '/static/';
|
|
24
24
|
|
|
25
|
-
// 是否初始化
|
|
26
|
-
let inited = false;
|
|
25
|
+
// 是否初始化
|
|
26
|
+
let inited = false;
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
/**
|
|
29
|
+
* 路由拦截
|
|
30
|
+
* 权限验证
|
|
31
|
+
*/
|
|
32
32
|
|
|
33
|
-
router.beforeEach(async (to, from, next) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
router.beforeEach(async (to, from, next) => {
|
|
34
|
+
if (Setting.showProgressBar) {
|
|
35
|
+
ViewUIPlus.LoadingBar.start();
|
|
36
|
+
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
if (!inited) {
|
|
39
|
+
// 初始化动态路由
|
|
40
|
+
let dynamicRoutes = await dynamic.init(router, pages, layout);
|
|
41
|
+
let frameInRoutes = router.getRoutes();
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
// 处理路由 得到每一级的路由设置
|
|
44
|
+
store.commit('admin/page/init', [...frameInRoutes, ...dynamicRoutes]);
|
|
45
|
+
inited = true;
|
|
46
|
+
next({
|
|
47
|
+
...to,
|
|
48
|
+
replace: true
|
|
49
|
+
});
|
|
50
|
+
} else {
|
|
51
|
+
// 判断是否需要登录才可以进入
|
|
52
|
+
if (to.matched.some(_ => _.meta.auth)) {
|
|
53
|
+
// 这里依据 token 判断是否登录,可视情况修改
|
|
54
|
+
const token = util.cookies.get('token');
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
if (token && token !== 'undefined') {
|
|
57
|
+
next();
|
|
58
|
+
} else {
|
|
59
|
+
// 没有登录的时候跳转到登录界面
|
|
60
|
+
// 携带上登陆成功之后需要跳转的页面完整路径
|
|
61
|
+
next({
|
|
62
|
+
name: 'login',
|
|
63
|
+
query: {
|
|
64
|
+
redirect: to.fullPath
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
58
68
|
} else {
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
next({
|
|
62
|
-
name: 'login',
|
|
63
|
-
query: {
|
|
64
|
-
redirect: to.fullPath
|
|
65
|
-
}
|
|
66
|
-
});
|
|
69
|
+
// 不需要身份校验 直接通过
|
|
70
|
+
next();
|
|
67
71
|
}
|
|
68
|
-
} else {
|
|
69
|
-
// 不需要身份校验 直接通过
|
|
70
|
-
next();
|
|
71
72
|
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
73
|
+
});
|
|
74
74
|
|
|
75
|
-
router.afterEach(to => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
router.afterEach(to => {
|
|
76
|
+
if (Setting.showProgressBar) ViewUIPlus.LoadingBar.finish();
|
|
77
|
+
// 多页控制 打开新的页面
|
|
78
|
+
if (!('meta' in to) || (to.meta && !('tabs' in to.meta)) || (to.meta && to.meta.tabs)) {
|
|
79
|
+
store.dispatch('admin/page/open', to);
|
|
80
|
+
}
|
|
81
|
+
// 更改标题
|
|
82
|
+
util.title({
|
|
83
|
+
title: to.meta.title
|
|
84
|
+
});
|
|
85
|
+
// 返回页面顶端
|
|
86
|
+
window.scrollTo(0, 0);
|
|
84
87
|
});
|
|
85
|
-
// 返回页面顶端
|
|
86
|
-
window.scrollTo(0, 0);
|
|
87
|
-
});
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
return router;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// 获取路由
|
|
93
|
+
const getRouter = () => {
|
|
94
|
+
return router;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export { create as createRouter, getRouter };
|
package/src/setting.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Admin Plus 业务配置
|
|
3
3
|
* */
|
|
4
4
|
|
|
5
|
-
const basePath = import.meta.env.VITE_APP_BASE_PATH;
|
|
5
|
+
//const basePath = import.meta.env.VITE_APP_BASE_PATH;
|
|
6
6
|
|
|
7
7
|
const Setting = {
|
|
8
8
|
/**
|
|
@@ -13,7 +13,7 @@ const Setting = {
|
|
|
13
13
|
// 项目的 ID
|
|
14
14
|
appID: 'app',
|
|
15
15
|
// 根目录
|
|
16
|
-
rootPath: basePath == '' || basePath == null ? '/static/' : '/' + basePath + '/static/',
|
|
16
|
+
//rootPath: basePath == '' || basePath == null ? '/static/' : '/' + basePath + '/static/',
|
|
17
17
|
// 网页标题的后缀,不需要设置为 false 或空
|
|
18
18
|
titleSuffix: 'Admin Plus',
|
|
19
19
|
// 路由模式,可选值为 history 或 hash
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 注册、登录、注销
|
|
3
3
|
* */
|
|
4
4
|
import util from '../../../../libs/util';
|
|
5
|
-
import
|
|
5
|
+
import { getRouter } from '../../../../router';
|
|
6
6
|
import userApi from '../../../../api/user';
|
|
7
7
|
import swal from 'sweetalert2';
|
|
8
8
|
|
|
@@ -59,7 +59,7 @@ export default {
|
|
|
59
59
|
// 清空 vuex 用户信息
|
|
60
60
|
await dispatch('admin/user/set', {}, { root: true });
|
|
61
61
|
// 跳转路由
|
|
62
|
-
|
|
62
|
+
getRouter().push({
|
|
63
63
|
name: 'login'
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 一般情况下,您无需修改此文件
|
|
4
4
|
* */
|
|
5
5
|
import util from '../../../../libs/util';
|
|
6
|
-
import
|
|
6
|
+
import { getRouter } from '../../../../router';
|
|
7
7
|
import { cloneDeep } from 'lodash';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -130,7 +130,7 @@ export default {
|
|
|
130
130
|
util.db.get(
|
|
131
131
|
pathInit({
|
|
132
132
|
dbName: 'database',
|
|
133
|
-
path: `$page.${
|
|
133
|
+
path: `$page.${getRouter().app.$route[basis]}`,
|
|
134
134
|
user,
|
|
135
135
|
defaultValue: {}
|
|
136
136
|
})
|
|
@@ -150,7 +150,7 @@ export default {
|
|
|
150
150
|
util.db.get(
|
|
151
151
|
pathInit({
|
|
152
152
|
dbName: 'database',
|
|
153
|
-
path: `$page.${
|
|
153
|
+
path: `$page.${getRouter().app.$route[basis]}`,
|
|
154
154
|
user,
|
|
155
155
|
validator: () => false,
|
|
156
156
|
defaultValue: {}
|
|
@@ -172,7 +172,7 @@ export default {
|
|
|
172
172
|
util.db.get(
|
|
173
173
|
pathInit({
|
|
174
174
|
dbName: 'database',
|
|
175
|
-
path: `$page.${
|
|
175
|
+
path: `$page.${getRouter().app.$route[basis]}.$data`,
|
|
176
176
|
user,
|
|
177
177
|
validator: () => false,
|
|
178
178
|
defaultValue: cloneDeep(instance.$data)
|
|
@@ -196,7 +196,7 @@ export default {
|
|
|
196
196
|
.get(
|
|
197
197
|
pathInit({
|
|
198
198
|
dbName: 'database',
|
|
199
|
-
path: `$page.${
|
|
199
|
+
path: `$page.${getRouter().app.$route[basis]}.$data`,
|
|
200
200
|
user,
|
|
201
201
|
defaultValue: cloneDeep(instance.$data)
|
|
202
202
|
})
|
|
@@ -218,7 +218,7 @@ export default {
|
|
|
218
218
|
util.db.get(
|
|
219
219
|
pathInit({
|
|
220
220
|
dbName: 'database',
|
|
221
|
-
path: `$page.${
|
|
221
|
+
path: `$page.${getRouter().app.$route[basis]}.$data`,
|
|
222
222
|
user,
|
|
223
223
|
validator: () => false,
|
|
224
224
|
defaultValue: {}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
getNativeMenuHeader,
|
|
15
15
|
getNativePermission
|
|
16
16
|
} from '../../../../libs/system';
|
|
17
|
-
import
|
|
17
|
+
import { getRouter } from '../../../../router';
|
|
18
18
|
import permissionApi from '../../../../api/permission';
|
|
19
19
|
|
|
20
20
|
// 根据 menu 配置的权限,过滤菜单
|
|
@@ -317,7 +317,7 @@ export default {
|
|
|
317
317
|
//setNativeMenuHeader(res.header);
|
|
318
318
|
setNativeMenuSider(menu);
|
|
319
319
|
if (loadMenu) {
|
|
320
|
-
const to = loadMenu === true ?
|
|
320
|
+
const to = loadMenu === true ? getRouter().currentRoute.value : loadMenu;
|
|
321
321
|
dispatch('setMenuList', to);
|
|
322
322
|
}
|
|
323
323
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 多标签页
|
|
3
3
|
* */
|
|
4
4
|
import { cloneDeep, get } from 'lodash';
|
|
5
|
-
import
|
|
5
|
+
import { getRouter } from '../../../../router';
|
|
6
6
|
import Setting from '../../../../setting';
|
|
7
7
|
import menuSider from '../../../../menu/sider';
|
|
8
8
|
import { getAllSiderMenu, includeArray } from '../../../../libs/system';
|
|
@@ -264,7 +264,7 @@ export default {
|
|
|
264
264
|
params,
|
|
265
265
|
query
|
|
266
266
|
};
|
|
267
|
-
|
|
267
|
+
getRouter().push(routerObj, () => {});
|
|
268
268
|
}
|
|
269
269
|
// end
|
|
270
270
|
resolve();
|
|
@@ -288,8 +288,8 @@ export default {
|
|
|
288
288
|
state.opened.splice(1, currentIndex - 1).forEach(({ name }) => commit('keepAliveRemove', name));
|
|
289
289
|
}
|
|
290
290
|
state.current = pageAim;
|
|
291
|
-
if (
|
|
292
|
-
|
|
291
|
+
if (getRouter().currentRoute.value.fullPath !== pageAim) {
|
|
292
|
+
getRouter().push(pageAim);
|
|
293
293
|
}
|
|
294
294
|
// 持久化
|
|
295
295
|
await dispatch('opened2db');
|
|
@@ -314,8 +314,8 @@ export default {
|
|
|
314
314
|
state.opened.splice(currentIndex + 1).forEach(({ name }) => commit('keepAliveRemove', name));
|
|
315
315
|
// 设置当前的页面
|
|
316
316
|
state.current = pageAim;
|
|
317
|
-
if (
|
|
318
|
-
|
|
317
|
+
if (getRouter().currentRoute.value.fullPath !== pageAim) {
|
|
318
|
+
getRouter().push(pageAim);
|
|
319
319
|
}
|
|
320
320
|
// 持久化
|
|
321
321
|
await dispatch('opened2db');
|
|
@@ -345,8 +345,8 @@ export default {
|
|
|
345
345
|
}
|
|
346
346
|
// 设置新的页面
|
|
347
347
|
state.current = pageAim;
|
|
348
|
-
if (
|
|
349
|
-
|
|
348
|
+
if (getRouter().currentRoute.value.fullPath !== pageAim) {
|
|
349
|
+
getRouter().push(pageAim);
|
|
350
350
|
}
|
|
351
351
|
// 持久化
|
|
352
352
|
await dispatch('opened2db');
|
|
@@ -365,8 +365,8 @@ export default {
|
|
|
365
365
|
// 持久化
|
|
366
366
|
await dispatch('opened2db');
|
|
367
367
|
// 关闭所有的标签页后需要判断一次现在是不是在首页
|
|
368
|
-
if (
|
|
369
|
-
|
|
368
|
+
if (getRouter().currentRoute.value.name !== 'index') {
|
|
369
|
+
getRouter().push(
|
|
370
370
|
{
|
|
371
371
|
name: 'index'
|
|
372
372
|
},
|
package/test/main.js
CHANGED
|
@@ -2,12 +2,13 @@ if (!!window.ActiveXObject || 'ActiveXObject' in window) {
|
|
|
2
2
|
alert('本系统不支持ie,请使用Chrome、Firefox、Edge等现代浏览器访问!');
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
import { createApp, h, getCurrentInstance } from 'vue';
|
|
6
|
+
|
|
5
7
|
// 基础框架
|
|
6
|
-
import moohoBaseAdminPlus, { pages,
|
|
8
|
+
import moohoBaseAdminPlus, { pages, App, store, i18n, basicLayout, createRouter, created, routeChanged } from '../src';
|
|
7
9
|
|
|
8
10
|
// 固定路由
|
|
9
11
|
import routes from './router/routes';
|
|
10
|
-
//import { frameInRoutes } from './router/routes';
|
|
11
12
|
|
|
12
13
|
// 自定义css
|
|
13
14
|
import './styles/css/custom.css';
|
|
@@ -22,13 +23,8 @@ Object.keys(files).forEach(key => {
|
|
|
22
23
|
pages[key.replace(/(\.\/pages\/)/g, '')] = files[key].default;
|
|
23
24
|
});
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
router
|
|
27
|
-
|
|
28
|
-
// 添加静态路由
|
|
29
|
-
routes.forEach(route => {
|
|
30
|
-
router.addRoute(route);
|
|
31
|
-
});
|
|
26
|
+
// 创建路由
|
|
27
|
+
const router = createRouter(import.meta.env.VITE_APP_BASE_PATH, pages, basicLayout, routes);
|
|
32
28
|
|
|
33
29
|
const app = createApp({
|
|
34
30
|
// mixins: [mixinApp],
|
package/vite.config.js
CHANGED
package/.envpr
DELETED