@laiye_packages/uci 1.0.2 → 1.0.3

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/dist/index.js CHANGED
@@ -10279,8 +10279,18 @@ class base_LYBaseApp extends LYObject {
10279
10279
  }
10280
10280
  }
10281
10281
  try {
10282
- baseUrl = `${window.origin}/view/${this.name}/laiye`;
10283
- this._tenantName = "laiye";
10282
+ if ('development' === process.env.NODE_ENV) {
10283
+ baseUrl = `${window.origin}/view/${this.name}/laiye`;
10284
+ this._tenantName = "laiye";
10285
+ return baseUrl;
10286
+ }
10287
+ const parts = url.pathname.split('/');
10288
+ const index = parts.findIndex((part)=>'view' === part);
10289
+ if (-1 === index) throw new Error('view not found in URL');
10290
+ let tenantName = parts[index + 2];
10291
+ if (!tenantName) throw new Error('tenantName not found');
10292
+ baseUrl = `${window.origin}/view/${this.name}/${tenantName}`;
10293
+ this._tenantName = tenantName;
10284
10294
  return baseUrl;
10285
10295
  } catch (error) {
10286
10296
  console.error('Error getting base URL:', error);