antd-management-fast-framework 1.11.8 → 1.11.9

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.
@@ -3,6 +3,7 @@ declare class AuthorizationWrapper extends SupplementWrapper {
3
3
  componentAuthority: any;
4
4
  doDidMountTask: () => void;
5
5
  checkAuthority: (auth: any) => boolean;
6
+ checkAuthorities: (auth: any) => boolean;
6
7
  getCurrentOperator: () => any;
7
8
  reloadCurrentOperator: (callback?: any) => void;
8
9
  }
@@ -83,6 +83,10 @@ var AuthorizationWrapper = /*#__PURE__*/function (_SupplementWrapper) {
83
83
  return (0, _authority.checkHasAuthority)(auth);
84
84
  };
85
85
 
86
+ _this.checkAuthorities = function (auth) {
87
+ return (0, _authority.checkHasAuthorities)(auth);
88
+ };
89
+
86
90
  _this.getCurrentOperator = function () {
87
91
  var currentOperator = _this.props.global.currentOperator;
88
92
  return currentOperator;
@@ -1,5 +1,6 @@
1
1
  export function getAllAuthority(): any;
2
2
  export function checkIsSuper(): boolean;
3
+ export function checkHasAuthorities(authCollection: any): boolean;
3
4
  export function checkHasAuthority(auth: any): boolean;
4
5
  /**
5
6
  * 缓存用户权限数据体
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.checkHasAuthorities = checkHasAuthorities;
6
7
  exports.checkHasAuthority = checkHasAuthority;
7
8
  exports.checkIsSuper = checkIsSuper;
8
9
  exports.getAllAuthority = getAllAuthority;
@@ -76,6 +77,44 @@ function checkIsSuper() {
76
77
  return false;
77
78
  }
78
79
 
80
+ function checkHasAuthorities(authCollection) {
81
+ var result = false;
82
+
83
+ if ((0, _tools.isArray)(authCollection)) {
84
+ authCollection.forEach(function (auth) {
85
+ result = checkHasAuthority(auth);
86
+
87
+ if (result) {
88
+ return true;
89
+ }
90
+ });
91
+
92
+ for (var _auth in authCollection) {
93
+ result = checkHasAuthority(_auth);
94
+
95
+ if (result) {
96
+ break;
97
+ }
98
+ }
99
+
100
+ return result;
101
+ }
102
+
103
+ if ((0, _tools.isString)(authCollection)) {
104
+ result = checkHasAuthority(authCollection);
105
+ return result;
106
+ }
107
+
108
+ var text = '无效的待验证权限';
109
+ (0, _tools.showErrorMessage)({
110
+ message: text
111
+ });
112
+ (0, _tools.recordError)({
113
+ auth: auth
114
+ });
115
+ return result;
116
+ }
117
+
79
118
  function checkHasAuthority(auth) {
80
119
  var _accessWayCollection$;
81
120
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-management-fast-framework",
3
- "version": "1.11.8",
3
+ "version": "1.11.9",
4
4
  "description": "antd-management-fast-framework",
5
5
  "keywords": [
6
6
  "antd-management-fast-framework"