hifun-tools 1.4.36 → 1.4.38
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 +1 -0
- package/dist/init/index.js +6 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -1
package/dist/init/index.d.ts
CHANGED
package/dist/init/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { AesDecrypt, AesEncrypt } from "./ende";
|
|
|
5
5
|
import { closeLoadingText, loadingText, rewardMsg } from "../msg";
|
|
6
6
|
import { Cache } from "../utils";
|
|
7
7
|
import { uniq } from "lodash-es";
|
|
8
|
+
import { getDomain } from "tldts";
|
|
8
9
|
class InitCls {
|
|
9
10
|
AesDecrypt = AesDecrypt;
|
|
10
11
|
AesEncrypt = AesEncrypt;
|
|
@@ -21,14 +22,16 @@ class InitCls {
|
|
|
21
22
|
localPath = "";
|
|
22
23
|
onlyBackUp = false;
|
|
23
24
|
OriginBaseUrl = [];
|
|
25
|
+
retry = false;
|
|
24
26
|
tenant = "";
|
|
25
27
|
tenantConfig = null;
|
|
26
28
|
tenantDict = null;
|
|
27
29
|
tenantDictList = [];
|
|
28
30
|
/** 初始化配置入口 */
|
|
29
31
|
async InitConfig(options) {
|
|
30
|
-
const { fileType, defaultBaseUrl, localPath, appLine, appTenant, appGateway = "", backupAddress, retry, lineDictData, lineAddressData, // ✨ 提取参数
|
|
32
|
+
const { fileType, defaultBaseUrl, localPath, appLine, appTenant, appGateway = "", backupAddress, retry = false, lineDictData, lineAddressData, // ✨ 提取参数
|
|
31
33
|
} = options;
|
|
34
|
+
this.retry = retry;
|
|
32
35
|
if (defaultBaseUrl)
|
|
33
36
|
this.defaultBaseUrl = defaultBaseUrl;
|
|
34
37
|
if (localPath)
|
|
@@ -105,7 +108,7 @@ class InitCls {
|
|
|
105
108
|
}
|
|
106
109
|
/** 严格初始化租户信息 */
|
|
107
110
|
async _initializeTenant(lineDictData) {
|
|
108
|
-
if (this.initialized)
|
|
111
|
+
if (this.initialized && !this.retry)
|
|
109
112
|
return this.tenant;
|
|
110
113
|
try {
|
|
111
114
|
const tenantInfo = await this._getTenantInfoStrictSync(lineDictData);
|
|
@@ -125,7 +128,7 @@ class InitCls {
|
|
|
125
128
|
if (lineDictData) {
|
|
126
129
|
try {
|
|
127
130
|
const data = JSON.parse(AesDecrypt(lineDictData));
|
|
128
|
-
const host = location.host;
|
|
131
|
+
const host = getDomain(location.host) || "";
|
|
129
132
|
if (this.getIsApp()) {
|
|
130
133
|
this.tenantDict = {
|
|
131
134
|
browserCheck: [],
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.4.
|
|
1
|
+
export declare const VERSION = "1.4.37";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.4.
|
|
1
|
+
export const VERSION = "1.4.37";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hifun-tools",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.38",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"jest-environment-jsdom": "^30.2.0",
|
|
26
26
|
"jscodeshift": "^17.3.0",
|
|
27
27
|
"prettier": "^3.6.2",
|
|
28
|
+
"tldts": "^7.0.28",
|
|
28
29
|
"ts-jest": "^29.4.5",
|
|
29
30
|
"typescript": "^5.6.3"
|
|
30
31
|
},
|