hifun-tools 1.3.10 → 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.
- package/dist/init/index.d.ts +3 -1
- package/dist/init/index.js +15 -3
- package/package.json +1 -1
package/dist/init/index.d.ts
CHANGED
|
@@ -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;
|
package/dist/init/index.js
CHANGED
|
@@ -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) {
|
|
@@ -90,7 +91,10 @@ class InitCls {
|
|
|
90
91
|
throw error;
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
async InitConfig({ fileType }) {
|
|
94
|
+
async InitConfig({ fileType, defaultBaseUrl, }) {
|
|
95
|
+
if (defaultBaseUrl) {
|
|
96
|
+
this.defaultBaseUrl = defaultBaseUrl;
|
|
97
|
+
}
|
|
94
98
|
console.log("加载类型:", fileType);
|
|
95
99
|
const tasks = [];
|
|
96
100
|
if (fileType.includes("lineAddress")) {
|
|
@@ -130,8 +134,16 @@ class InitCls {
|
|
|
130
134
|
return this.domainBaseUrl;
|
|
131
135
|
}
|
|
132
136
|
catch (error) {
|
|
133
|
-
|
|
134
|
-
|
|
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
|
+
}
|
|
135
147
|
}
|
|
136
148
|
}
|
|
137
149
|
AesEncrypt = AesEncrypt;
|