hifun-tools 1.4.42 → 1.4.44
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 +7 -0
- package/dist/init/index.js +10 -6
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/init/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ declare class InitCls {
|
|
|
21
21
|
private tenantConfig;
|
|
22
22
|
private tenantDict;
|
|
23
23
|
private tenantDictList;
|
|
24
|
+
getDomain(e: string): string | null;
|
|
24
25
|
/** 初始化配置入口 */
|
|
25
26
|
InitConfig(options: {
|
|
26
27
|
fileType?: string[];
|
|
@@ -55,6 +56,7 @@ declare class InitCls {
|
|
|
55
56
|
private _getTenantInfoStrictSync;
|
|
56
57
|
/** 匹配默认租户 */
|
|
57
58
|
private _matchDefaultTenant;
|
|
59
|
+
getHostUrl(): string;
|
|
58
60
|
retryHttp(): Promise<void>;
|
|
59
61
|
refreshHttp(): Promise<void>;
|
|
60
62
|
/** 获取 lineDict.txt 内容 */
|
|
@@ -65,6 +67,11 @@ declare class InitCls {
|
|
|
65
67
|
private _loadGatewayConfig;
|
|
66
68
|
}
|
|
67
69
|
declare const HF: InitCls;
|
|
70
|
+
declare global {
|
|
71
|
+
interface Window {
|
|
72
|
+
HF: any;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
68
75
|
export type TenantConfig = {
|
|
69
76
|
PUBLIC_TITLE: string;
|
|
70
77
|
SITE_TITLE: string;
|
package/dist/init/index.js
CHANGED
|
@@ -27,6 +27,9 @@ class InitCls {
|
|
|
27
27
|
tenantConfig = null;
|
|
28
28
|
tenantDict = null;
|
|
29
29
|
tenantDictList = [];
|
|
30
|
+
getDomain(e) {
|
|
31
|
+
return getDomain(e);
|
|
32
|
+
}
|
|
30
33
|
/** 初始化配置入口 */
|
|
31
34
|
async InitConfig(options) {
|
|
32
35
|
const { fileType, defaultBaseUrl, localPath, appLine, appTenant, appGateway = "", backupAddress, retry = false, lineDictData, lineAddressData, // ✨ 提取参数
|
|
@@ -128,7 +131,7 @@ class InitCls {
|
|
|
128
131
|
if (lineDictData) {
|
|
129
132
|
try {
|
|
130
133
|
const data = JSON.parse(AesDecrypt(lineDictData));
|
|
131
|
-
const host = getHostUrl();
|
|
134
|
+
const host = this.getHostUrl();
|
|
132
135
|
if (this.getIsApp()) {
|
|
133
136
|
this.tenantDict = {
|
|
134
137
|
browserCheck: [],
|
|
@@ -159,7 +162,7 @@ class InitCls {
|
|
|
159
162
|
try {
|
|
160
163
|
const rawText = await this._fetchLineDict();
|
|
161
164
|
const data = JSON.parse(AesDecrypt(rawText));
|
|
162
|
-
const host = getHostUrl();
|
|
165
|
+
const host = this.getHostUrl();
|
|
163
166
|
this.tenantDictList = [...data];
|
|
164
167
|
if (this.getIsApp()) {
|
|
165
168
|
this.tenantDict = {
|
|
@@ -187,7 +190,7 @@ class InitCls {
|
|
|
187
190
|
}
|
|
188
191
|
/** 匹配默认租户 */
|
|
189
192
|
_matchDefaultTenant() {
|
|
190
|
-
const host = getHostUrl();
|
|
193
|
+
const host = this.getHostUrl();
|
|
191
194
|
if (this.getIsApp()) {
|
|
192
195
|
console.info("🏠 匹配到app传入租户");
|
|
193
196
|
return { tenant: this.appTenant };
|
|
@@ -201,6 +204,9 @@ class InitCls {
|
|
|
201
204
|
}
|
|
202
205
|
throw new Error("无法获取有效的租户信息");
|
|
203
206
|
}
|
|
207
|
+
getHostUrl() {
|
|
208
|
+
return getDomain(location.host) ? getDomain(location.host) : location.host;
|
|
209
|
+
}
|
|
204
210
|
async retryHttp() {
|
|
205
211
|
try {
|
|
206
212
|
if (this.onlyBackUp)
|
|
@@ -413,7 +419,5 @@ class InitCls {
|
|
|
413
419
|
}
|
|
414
420
|
const HF = new InitCls();
|
|
415
421
|
const t1BackGateWay = ["https://s3.t1game888.com/gateway/lineAddress.txt"];
|
|
416
|
-
|
|
417
|
-
return getDomain(location.host) ? getDomain(location.host) : location.host;
|
|
418
|
-
}
|
|
422
|
+
window.HF = HF;
|
|
419
423
|
export { HF, isDomainMatch, toStandardUrl, AesEncrypt, AesDecrypt, filterSmartLines, matchBrowser, getOptimalDecodedString, };
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.4.
|
|
1
|
+
export declare const VERSION = "1.4.43";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.4.
|
|
1
|
+
export const VERSION = "1.4.43";
|