gw-gis-standard-global-vue3 1.1.74 → 1.1.76

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.
@@ -1011,12 +1011,12 @@ var gisGlobal = /*#__PURE__*/function () {
1011
1011
  // getRouters.homePageMsg.meta.visible = false
1012
1012
  }
1013
1013
  if (this.isTypeInArray(routerList, 'string')) {
1014
- // 侧边栏
1014
+ // 导航栏
1015
1015
  if (getRouters.topMenuList.length > 0) {
1016
- filterRolesRouterFn2(getRouters.topMenuList, routerList, menuFilterKey);
1016
+ filterRolesRouterFn2(getRouters.topMenuList, routerList, menuFilterKey, 'top');
1017
1017
  }
1018
- // 导航栏
1019
- filterRolesRouterFn2(getRouters.getRouters, routerList, menuFilterKey);
1018
+ // 侧边栏
1019
+ filterRolesRouterFn2(getRouters.getRouters, routerList, menuFilterKey, 'side');
1020
1020
  }
1021
1021
  if (homePathCode) {
1022
1022
  // 去掉首页重定向方便自定义
@@ -2912,19 +2912,57 @@ var GisPermission = /*#__PURE__*/function () {
2912
2912
  var findRoute = to.matched.find(function (item) {
2913
2913
  return item.path === '/' + firstPath;
2914
2914
  });
2915
+ if (!findRoute) {
2916
+ findRoute = lastRouteMsg;
2917
+ }
2915
2918
  if (findRoute) {
2916
- var findRouteMsg = recursionRouteFn(findRoute.children);
2917
- // console.log('findRouteMsgfindRouteMsg', findRouteMsg)
2919
+ var findRouteMsg;
2920
+ if (findRoute.children.length > 0) {
2921
+ findRouteMsg = recursionRouteFn(findRoute.children);
2922
+ } else {
2923
+ findRouteMsg = lastRouteMsg;
2924
+ }
2918
2925
  if (findRouteMsg) {
2919
- var _findRouteMsg$meta;
2920
- if (!(findRouteMsg !== null && findRouteMsg !== void 0 && (_findRouteMsg$meta = findRouteMsg.meta) !== null && _findRouteMsg$meta !== void 0 && _findRouteMsg$meta.visible)) {
2926
+ var _findRouteMsg, _findRouteMsg4, _findRouteMsg5;
2927
+ // 进入首页 如果配置的首页该用户无法访问,则跳转到第一个显示的页面
2928
+ if ((_findRouteMsg = findRouteMsg) !== null && _findRouteMsg !== void 0 && (_findRouteMsg = _findRouteMsg.meta) !== null && _findRouteMsg !== void 0 && _findRouteMsg.isHomePage || to.redirectedFrom && to.redirectedFrom.path === "/" || to.redirectedFrom && to.redirectedFrom.fullPath === "/" || to.path === "/") {
2929
+ var _to$meta, _to$meta2, _findRouteMsg2, _findRouteMsg3, _lastRouteMsg$meta, _lastRouteMsg$meta2;
2930
+ if (to !== null && to !== void 0 && (_to$meta = to.meta) !== null && _to$meta !== void 0 && _to$meta.hasOwnProperty('visible') && !(to !== null && to !== void 0 && (_to$meta2 = to.meta) !== null && _to$meta2 !== void 0 && _to$meta2.visible) || (_findRouteMsg2 = findRouteMsg) !== null && _findRouteMsg2 !== void 0 && (_findRouteMsg2 = _findRouteMsg2.meta) !== null && _findRouteMsg2 !== void 0 && _findRouteMsg2.hasOwnProperty('visible') && !((_findRouteMsg3 = findRouteMsg) !== null && _findRouteMsg3 !== void 0 && (_findRouteMsg3 = _findRouteMsg3.meta) !== null && _findRouteMsg3 !== void 0 && _findRouteMsg3.visible) || lastRouteMsg !== null && lastRouteMsg !== void 0 && (_lastRouteMsg$meta = lastRouteMsg.meta) !== null && _lastRouteMsg$meta !== void 0 && _lastRouteMsg$meta.hasOwnProperty('visible') && !(lastRouteMsg !== null && lastRouteMsg !== void 0 && (_lastRouteMsg$meta2 = lastRouteMsg.meta) !== null && _lastRouteMsg$meta2 !== void 0 && _lastRouteMsg$meta2.visible)) {
2931
+ var hasShowHomePage = undefined;
2932
+ for (var i = 0; i < to.matched[0].children.length; i++) {
2933
+ if (!to.matched[0].children[i].meta.hasOwnProperty('visible') || to.matched[0].children[i].meta.visible) {
2934
+ hasShowHomePage = recursionRouteFn(to.matched[0].children[i].children);
2935
+ if (hasShowHomePage) {
2936
+ break;
2937
+ }
2938
+ }
2939
+ }
2940
+ if (hasShowHomePage) {
2941
+ var _hasShowHomePage;
2942
+ getCache(constType.SESSION_STORAGE).remove(constType.TOP_MENU);
2943
+ next({
2944
+ path: hasShowHomePage.path,
2945
+ query: (_hasShowHomePage = hasShowHomePage) === null || _hasShowHomePage === void 0 || (_hasShowHomePage = _hasShowHomePage.meta) === null || _hasShowHomePage === void 0 ? void 0 : _hasShowHomePage.query
2946
+ });
2947
+ }
2948
+ }
2949
+ } else if ((_findRouteMsg4 = findRouteMsg) !== null && _findRouteMsg4 !== void 0 && (_findRouteMsg4 = _findRouteMsg4.meta) !== null && _findRouteMsg4 !== void 0 && _findRouteMsg4.hasOwnProperty('visible') && !((_findRouteMsg5 = findRouteMsg) !== null && _findRouteMsg5 !== void 0 && (_findRouteMsg5 = _findRouteMsg5.meta) !== null && _findRouteMsg5 !== void 0 && _findRouteMsg5.visible)) {
2950
+ getCache(constType.SESSION_STORAGE).remove(constType.TOP_MENU);
2951
+ next(constType.NO_IN_LAYOUT_MSG.FORBIDDEN);
2952
+ } else if (from.path === findRouteMsg.path) {
2953
+ getCache(constType.SESSION_STORAGE).remove(constType.TOP_MENU);
2921
2954
  next(constType.NO_IN_LAYOUT_MSG.FORBIDDEN);
2922
2955
  } else {
2923
- var _findRouteMsg$meta2;
2924
- next({
2925
- path: findRouteMsg.path,
2926
- query: findRouteMsg === null || findRouteMsg === void 0 || (_findRouteMsg$meta2 = findRouteMsg.meta) === null || _findRouteMsg$meta2 === void 0 ? void 0 : _findRouteMsg$meta2.query
2927
- });
2956
+ var _to$meta3;
2957
+ if ((_to$meta3 = to.meta) !== null && _to$meta3 !== void 0 && _to$meta3.hasOwnProperty('visible') && !to.meta.visible) {
2958
+ next(constType.NO_IN_LAYOUT_MSG.FORBIDDEN);
2959
+ } else {
2960
+ var _findRouteMsg6;
2961
+ next({
2962
+ path: findRouteMsg.path,
2963
+ query: (_findRouteMsg6 = findRouteMsg) === null || _findRouteMsg6 === void 0 || (_findRouteMsg6 = _findRouteMsg6.meta) === null || _findRouteMsg6 === void 0 ? void 0 : _findRouteMsg6.query
2964
+ });
2965
+ }
2928
2966
  }
2929
2967
  } else {
2930
2968
  next(constType.NO_IN_LAYOUT_MSG.ERROR);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gw-gis-standard-global-vue3",
3
- "version": "1.1.74",
3
+ "version": "1.1.76",
4
4
  "description": "gw js 库",
5
5
  "main": "gw-gis-standard-global.js",
6
6
  "scripts": {