hifun-tools 1.3.9 → 1.3.11

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.
@@ -10,6 +10,7 @@ declare class InitCls {
10
10
  private tenantConfig;
11
11
  private initialized;
12
12
  private tenant;
13
+ private defaultBaseUrl;
13
14
  getBaseUrl(): string;
14
15
  /** 获取配置 */
15
16
  getTenantConfig(): TenantConfig | null;
@@ -20,8 +21,9 @@ declare class InitCls {
20
21
  private getTenantInfoStrictSync;
21
22
  /** 严格初始化(必须在应用启动时调用) */
22
23
  private initialize;
23
- InitConfig({ fileType }: {
24
+ InitConfig({ fileType, defaultBaseUrl, }: {
24
25
  fileType: string[];
26
+ defaultBaseUrl?: string;
25
27
  }): Promise<any[]>;
26
28
  private LoadGatewayConfig;
27
29
  AesEncrypt: typeof AesEncrypt;
@@ -6,6 +6,7 @@ class InitCls {
6
6
  tenantConfig = null;
7
7
  initialized = false;
8
8
  tenant = "";
9
+ defaultBaseUrl = "";
9
10
  getBaseUrl() {
10
11
  console.log("this.domainBaseUrl", this.domainBaseUrl);
11
12
  if (!this.domainBaseUrl) {
@@ -37,7 +38,6 @@ class InitCls {
37
38
  method: "GET",
38
39
  cache: "no-store",
39
40
  });
40
- console.log(response);
41
41
  if (!response.ok) {
42
42
  throw new Error(`HTTP 状态码错误: ${response.status}`);
43
43
  }
@@ -91,7 +91,10 @@ class InitCls {
91
91
  throw error;
92
92
  }
93
93
  }
94
- async InitConfig({ fileType }) {
94
+ async InitConfig({ fileType, defaultBaseUrl, }) {
95
+ if (defaultBaseUrl) {
96
+ this.defaultBaseUrl = defaultBaseUrl;
97
+ }
95
98
  console.log("加载类型:", fileType);
96
99
  const tasks = [];
97
100
  if (fileType.includes("lineAddress")) {
@@ -131,8 +134,16 @@ class InitCls {
131
134
  return this.domainBaseUrl;
132
135
  }
133
136
  catch (error) {
134
- console.warn("⚠️ 加载 lineAddress.txt 失败:", error);
135
- return null;
137
+ if (this.defaultBaseUrl &&
138
+ (location.host.includes("iggame") ||
139
+ location.host.includes("localhost"))) {
140
+ console.info(`🏠 iggame匹配到默认链接`, this.defaultBaseUrl);
141
+ this.domainBaseUrl = this.defaultBaseUrl;
142
+ }
143
+ else {
144
+ console.warn("⚠️ 加载 lineAddress.txt 失败:", error);
145
+ return null;
146
+ }
136
147
  }
137
148
  }
138
149
  AesEncrypt = AesEncrypt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hifun-tools",
3
- "version": "1.3.9",
3
+ "version": "1.3.11",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",