vue2-client 1.8.28 → 1.8.29

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/CHANGELOG.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
- **1.8.27 -2023-1-10 @张振宇**
4
+ **1.8.29 -2023-1-10 @张振宇**
5
5
  - 微前端兼容
6
6
 
7
7
  **1.8.26 -2023-1-10 @杨亚文**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.28",
3
+ "version": "1.8.29",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -35,8 +35,9 @@ const progressStart = (to, from, next) => {
35
35
  * @param options
36
36
  */
37
37
  const loginGuard = (to, from, next, options) => {
38
- console.log('loginGuard', to, from, next, options)
39
-
38
+ if (window.__MICRO_APP_ENVIRONMENT__) {
39
+ window.microApp.dispatch({ type: '子应用发送给主应用的数据', to: to.path })
40
+ }
40
41
  const urlParams = new URLSearchParams(window.location.search)
41
42
  const token = urlParams.get('token')
42
43
  const V4_LOGIN_DATA_KEY = localStorage.getItem('v4LoginData')
@@ -89,7 +90,7 @@ const loginGuard = (to, from, next, options) => {
89
90
  r: v4LoginData.r
90
91
  }
91
92
  Vue.$store.commit('account/setLogin', login)
92
- // loadRoutes(funcToRouter(v4LoginData.functions))
93
+ loadRoutes(funcToRouter(v4LoginData.functions))
93
94
  next()
94
95
  } else {
95
96
  const { store, message } = options
@@ -358,10 +358,7 @@ function parsefunc (func) {
358
358
  * 资源服务路由排序
359
359
  */
360
360
  function positionRouter (r) {
361
- let router = []
362
- for (const row of r) {
363
- router[row.position] = row
364
- }
361
+ let router = r.sort((a, b) => a.position - b.position)
365
362
  router = arrRemoveEmpty(router)
366
363
  return router
367
364
  }