@aliyun-obv/api 4.7.0 → 4.7.1

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.
Files changed (2) hide show
  1. package/dist/api.es.js +6 -5
  2. package/package.json +1 -1
package/dist/api.es.js CHANGED
@@ -507,7 +507,7 @@ const ERROR_TITLE = i18n.ERROR;
507
507
  i18n.OK;
508
508
  let isGlobalAlertShow = false;
509
509
  function showConsoleBaseAlertDialog(response, config = {}, request, extra = {}) {
510
- var _a, _b, _c;
510
+ var _a, _b, _c, _d;
511
511
  if ((response == null ? void 0 : response.code) === "200") {
512
512
  return false;
513
513
  }
@@ -522,11 +522,12 @@ function showConsoleBaseAlertDialog(response, config = {}, request, extra = {})
522
522
  method: request ? request.method : void 0
523
523
  }, extra || {})
524
524
  };
525
- if (response.code === "Unauthorized") {
526
- if ((_a = response == null ? void 0 : response.rawResponseError) == null ? void 0 : _a.accessDeniedDetail) {
525
+ const responseCode = (_a = response.code) == null ? void 0 : _a.toLowerCase();
526
+ if (responseCode === "unauthorized" || responseCode === "nopermission") {
527
+ if ((_b = response == null ? void 0 : response.rawResponseError) == null ? void 0 : _b.accessDeniedDetail) {
527
528
  const detailsAuth = convertErrorDetaisAuth(response.rawResponseError.accessDeniedDetail);
528
529
  errorConfig.detailsAuth = detailsAuth;
529
- errorConfig.code = ((_b = response == null ? void 0 : response.rawResponseError) == null ? void 0 : _b.errorCode) || "Unauthorized";
530
+ errorConfig.code = ((_c = response == null ? void 0 : response.rawResponseError) == null ? void 0 : _c.errorCode) || "Unauthorized";
530
531
  errorPrompt(errorConfig);
531
532
  } else {
532
533
  const { action, resource } = extraActionAndResource(response.message);
@@ -534,7 +535,7 @@ function showConsoleBaseAlertDialog(response, config = {}, request, extra = {})
534
535
  errorConfig.details.ACTION = action;
535
536
  errorConfig.details.RESOURCE = resource;
536
537
  }
537
- errorConfig.code = ((_c = response == null ? void 0 : response.rawResponseError) == null ? void 0 : _c.errorCode) || "Unauthorized";
538
+ errorConfig.code = ((_d = response == null ? void 0 : response.rawResponseError) == null ? void 0 : _d.errorCode) || "Unauthorized";
538
539
  errorPrompt(errorConfig, config, true);
539
540
  }
540
541
  } else {
package/package.json CHANGED
@@ -15,5 +15,5 @@
15
15
  "styled-components": "^5.2.0",
16
16
  "urijs": "^1.19.1"
17
17
  },
18
- "version": "4.7.0"
18
+ "version": "4.7.1"
19
19
  }