@lark-apaas/client-toolkit 1.0.8 → 1.0.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.
@@ -2,10 +2,11 @@ function getAppId(path) {
2
2
  if (window.MIAODA_APP_ID) return window.MIAODA_APP_ID;
3
3
  let prefix;
4
4
  prefix = path.includes('/ai/feida/runtime/') ? '/ai/feida/runtime/' : path.includes('/spark/r/') ? '/spark/r/' : '/ai/miaoda/';
5
- if (!path.startsWith(prefix)) return null;
5
+ const windowAppId = window.appId || null;
6
+ if (!path.startsWith(prefix)) return windowAppId;
6
7
  const remainder = path.substring(prefix.length);
7
8
  const nextSlashIndex = remainder.indexOf('/');
8
- if (-1 === nextSlashIndex) return remainder;
9
- return remainder.substring(0, nextSlashIndex);
9
+ if (-1 === nextSlashIndex) return remainder || windowAppId;
10
+ return remainder.substring(0, nextSlashIndex) || windowAppId;
10
11
  }
11
12
  export { getAppId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/client-toolkit",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [