vap1 0.8.4 → 0.8.5

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.
@@ -33,10 +33,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
33
33
  exports.useApiGlobal = void 0;
34
34
  var lodash_1 = __importDefault(require("lodash"));
35
35
  var react_1 = require("react");
36
+ var PageUtil_1 = require("../utils/PageUtil");
36
37
  var _list_1 = require("./_list");
37
38
  var useGlobal_1 = require("./useGlobal");
38
39
  var useApiBase_1 = require("./useApiBase");
39
- var toKey = function (pathname, hash) {
40
+ var toKey = function () {
41
+ var pathname = location.pathname, hash = location.hash;
42
+ if (lodash_1.default.has(window, '__MICRO_APP_BASE_ROUTE__')) {
43
+ return (0, PageUtil_1.clearURL)(pathname);
44
+ }
40
45
  var root = lodash_1.default.trim(pathname).toLowerCase();
41
46
  if (root.endsWith('/'))
42
47
  root = root.substring(0, root.length - 1);
@@ -57,8 +62,7 @@ var useApiGlobal = function (options) {
57
62
  var namespace = (0, react_1.useMemo)(function () {
58
63
  if (config.namespace)
59
64
  return config.namespace;
60
- var pathname = location.pathname, hash = location.hash;
61
- return toKey(pathname, hash);
65
+ return toKey();
62
66
  }, []);
63
67
  var _a = __read((0, useGlobal_1.useGlobal)(namespace, BASE), 2), state = _a[0], doLoad = _a[1];
64
68
  return (0, useApiBase_1.useApiBase)(config, state, doLoad, 'api-global');
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"vap1","version":"0.8.4","description":"vap1, Both support MicroService and SAP FrameWork, Support IE>9","main":"index.js","author":"Xiang da","license":"ISC"}
1
+ {"name":"vap1","version":"0.8.5","description":"vap1, Both support MicroService and SAP FrameWork, Support IE>9","main":"index.js","author":"Xiang da","license":"ISC"}