@nocobase/sdk 0.20.0-alpha.8 → 0.21.0-alpha.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.
- package/lib/APIClient.js +1 -1
- package/lib/getSubAppName.d.ts +1 -1
- package/lib/getSubAppName.js +7 -5
- package/package.json +2 -2
package/lib/APIClient.js
CHANGED
|
@@ -61,7 +61,7 @@ const _Auth = class _Auth {
|
|
|
61
61
|
if (typeof window === "undefined") {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
const appName = (0, import_getSubAppName.default)();
|
|
64
|
+
const appName = (0, import_getSubAppName.default)(this.api["app"] ? this.api["app"].getPublicPath() : "/");
|
|
65
65
|
if (!appName) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
package/lib/getSubAppName.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const getSubAppName: () => string;
|
|
1
|
+
declare const getSubAppName: (publicPath?: string) => string;
|
|
2
2
|
export default getSubAppName;
|
package/lib/getSubAppName.js
CHANGED
|
@@ -21,11 +21,13 @@ __export(getSubAppName_exports, {
|
|
|
21
21
|
default: () => getSubAppName_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(getSubAppName_exports);
|
|
24
|
-
const getSubAppName = /* @__PURE__ */ __name(() => {
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
27
|
-
return
|
|
24
|
+
const getSubAppName = /* @__PURE__ */ __name((publicPath = "/") => {
|
|
25
|
+
const prefix = `${publicPath}apps/`;
|
|
26
|
+
if (!window.location.pathname.startsWith(prefix)) {
|
|
27
|
+
return;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
const pathname = window.location.pathname.substring(prefix.length);
|
|
30
|
+
const args = pathname.split("/", 1);
|
|
31
|
+
return args[0] || "";
|
|
30
32
|
}, "getSubAppName");
|
|
31
33
|
var getSubAppName_default = getSubAppName;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0-alpha.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"axios-mock-adapter": "^1.20.0"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "afd2f3d1341b85ea9daa7b2667dd4ace1fafb7ff"
|
|
15
15
|
}
|