@yysports/tools 0.1.2 → 0.1.4

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.
@@ -1,5 +1,4 @@
1
- import { RouteMapValueType } from '../Utils';
2
- import { AuthCenterUserProfile, CustomizeProfile, ErrorProfile, SystemProfile, TrackConfig, TrackType, UserProfile } from '../interfaces/track.interface';
1
+ import { AuthCenterUserProfile, CustomizeProfile, ErrorProfile, RouteMapValueType, SystemProfile, TrackConfig, TrackType, UserProfile } from '../interfaces/track.interface';
3
2
  declare class Track {
4
3
  static config: TrackConfig;
5
4
  static userProfile: UserProfile;
@@ -1,10 +1,2 @@
1
- export type AuthDataType = {
2
- children: AuthDataType[];
3
- name?: string;
4
- logAction?: string;
5
- permission?: string;
6
- meta?: {
7
- title: string;
8
- };
9
- };
1
+ import { AuthDataType } from '../interfaces/track.interface';
10
2
  export declare const getAuthMapByAuthCenter: (authData: AuthDataType[]) => Map<string, string>;
@@ -1,15 +1,4 @@
1
- export type RouteType = {
2
- path: string;
3
- redirect?: string;
4
- name?: string;
5
- access?: string;
6
- routes?: RouteType[];
7
- };
8
- export type RouteMapValueType = {
9
- access?: string;
10
- name?: string[];
11
- module?: string[];
12
- };
1
+ import { RouteMapValueType, RouteType } from '../interfaces/track.interface';
13
2
  export declare const getRoutesMap: (routes: RouteType[], menuNameMap?: {
14
3
  [key: string]: string;
15
4
  } | undefined) => Map<string, RouteMapValueType>;
@@ -5,7 +5,6 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
6
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
7
  // 根据本地路由配置文件、路由地址名称映射、当前用户权限,生成路由映射关系表
8
-
9
8
  export var getRoutesMap = function getRoutesMap(routes, menuNameMap) {
10
9
  var routesMap = new Map();
11
10
  var ergodicLocalMenu = function ergodicLocalMenu(rs, parentMenu) {
@@ -15,10 +14,6 @@ export var getRoutesMap = function getRoutesMap(routes, menuNameMap) {
15
14
  name = route.name,
16
15
  routes = route.routes,
17
16
  redirect = route.redirect;
18
- if (redirect || !name) {
19
- // 不统计重定向路由、无名称路由
20
- return;
21
- }
22
17
  var nameArr = _toConsumableArray((parentMenu === null || parentMenu === void 0 ? void 0 : parentMenu.name) || []);
23
18
  var moduleArr = _toConsumableArray((parentMenu === null || parentMenu === void 0 ? void 0 : parentMenu.module) || []);
24
19
  if (name) {
@@ -1,4 +1,3 @@
1
- import { RouteType } from '../Utils';
2
1
  export type LocalRouteItemType = {
3
2
  access?: string;
4
3
  name?: string;
@@ -72,3 +71,25 @@ export interface ErrorProfile {
72
71
  fileName: string;
73
72
  message: string;
74
73
  }
74
+ export type RouteType = {
75
+ path?: string;
76
+ redirect?: string;
77
+ name?: string;
78
+ access?: string;
79
+ routes?: RouteType[];
80
+ [key: string]: any;
81
+ };
82
+ export type RouteMapValueType = {
83
+ access?: string;
84
+ name?: string[];
85
+ module?: string[];
86
+ };
87
+ export type AuthDataType = {
88
+ children: AuthDataType[];
89
+ name?: string;
90
+ logAction?: string;
91
+ permission?: string;
92
+ meta?: {
93
+ title: string;
94
+ };
95
+ };
@@ -1,5 +1,4 @@
1
- import { RouteMapValueType } from '../Utils';
2
- import { AuthCenterUserProfile, CustomizeProfile, ErrorProfile, SystemProfile, TrackConfig, TrackType, UserProfile } from '../interfaces/track.interface';
1
+ import { AuthCenterUserProfile, CustomizeProfile, ErrorProfile, RouteMapValueType, SystemProfile, TrackConfig, TrackType, UserProfile } from '../interfaces/track.interface';
3
2
  declare class Track {
4
3
  static config: TrackConfig;
5
4
  static userProfile: UserProfile;
@@ -1,10 +1,2 @@
1
- export type AuthDataType = {
2
- children: AuthDataType[];
3
- name?: string;
4
- logAction?: string;
5
- permission?: string;
6
- meta?: {
7
- title: string;
8
- };
9
- };
1
+ import { AuthDataType } from '../interfaces/track.interface';
10
2
  export declare const getAuthMapByAuthCenter: (authData: AuthDataType[]) => Map<string, string>;
@@ -1,15 +1,4 @@
1
- export type RouteType = {
2
- path: string;
3
- redirect?: string;
4
- name?: string;
5
- access?: string;
6
- routes?: RouteType[];
7
- };
8
- export type RouteMapValueType = {
9
- access?: string;
10
- name?: string[];
11
- module?: string[];
12
- };
1
+ import { RouteMapValueType, RouteType } from '../interfaces/track.interface';
13
2
  export declare const getRoutesMap: (routes: RouteType[], menuNameMap?: {
14
3
  [key: string]: string;
15
4
  } | undefined) => Map<string, RouteMapValueType>;
@@ -27,9 +27,6 @@ var getRoutesMap = (routes, menuNameMap) => {
27
27
  const ergodicLocalMenu = (rs, parentMenu) => {
28
28
  rs.forEach((route) => {
29
29
  const { path, access, name, routes: routes2, redirect } = route;
30
- if (redirect || !name) {
31
- return;
32
- }
33
30
  const nameArr = [...(parentMenu == null ? void 0 : parentMenu.name) || []];
34
31
  const moduleArr = [...(parentMenu == null ? void 0 : parentMenu.module) || []];
35
32
  if (name) {
@@ -1,4 +1,3 @@
1
- import { RouteType } from '../Utils';
2
1
  export type LocalRouteItemType = {
3
2
  access?: string;
4
3
  name?: string;
@@ -72,3 +71,25 @@ export interface ErrorProfile {
72
71
  fileName: string;
73
72
  message: string;
74
73
  }
74
+ export type RouteType = {
75
+ path?: string;
76
+ redirect?: string;
77
+ name?: string;
78
+ access?: string;
79
+ routes?: RouteType[];
80
+ [key: string]: any;
81
+ };
82
+ export type RouteMapValueType = {
83
+ access?: string;
84
+ name?: string[];
85
+ module?: string[];
86
+ };
87
+ export type AuthDataType = {
88
+ children: AuthDataType[];
89
+ name?: string;
90
+ logAction?: string;
91
+ permission?: string;
92
+ meta?: {
93
+ title: string;
94
+ };
95
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yysports/tools",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "常用工具函数库",
5
5
  "homepage": "https://git.pousheng.com/sport-service-department/pousheng-guard/yysports_tools#readme",
6
6
  "bugs": {