hifun-tools 1.3.31 → 1.4.1
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 -1
- package/dist/init/index.js +6 -4
- package/dist/init/utils.js +0 -2
- package/package.json +1 -1
package/dist/init/index.d.ts
CHANGED
package/dist/init/index.js
CHANGED
|
@@ -143,9 +143,9 @@ class InitCls {
|
|
|
143
143
|
}
|
|
144
144
|
throw new Error("无法获取有效的租户信息");
|
|
145
145
|
}
|
|
146
|
-
refreshHttp() {
|
|
146
|
+
async refreshHttp() {
|
|
147
147
|
try {
|
|
148
|
-
getOptimalDecodedString([this.getBaseUrl()]);
|
|
148
|
+
await getOptimalDecodedString([this.getBaseUrl()]);
|
|
149
149
|
}
|
|
150
150
|
catch (error) {
|
|
151
151
|
rewardMsg({
|
|
@@ -186,10 +186,12 @@ class InitCls {
|
|
|
186
186
|
// 备用策略
|
|
187
187
|
let allBaseUrl = filterSmartLines(dictList, OriginBaseUrl);
|
|
188
188
|
try {
|
|
189
|
-
this.domainBaseUrl = toStandardUrl(await getOptimalDecodedString(difArr(allBaseUrl, baseUrl)
|
|
189
|
+
this.domainBaseUrl = toStandardUrl(await getOptimalDecodedString(difArr(allBaseUrl, baseUrl), {
|
|
190
|
+
filterIp: false,
|
|
191
|
+
}));
|
|
190
192
|
console.info("✅ 备用配置成功:", this.domainBaseUrl);
|
|
191
193
|
}
|
|
192
|
-
catch {
|
|
194
|
+
catch (err) {
|
|
193
195
|
this.domainBaseUrl = toStandardUrl(allBaseUrl[0]);
|
|
194
196
|
console.warn("⚠️ 备选测速失败,使用备用配置:", allBaseUrl);
|
|
195
197
|
}
|
package/dist/init/utils.js
CHANGED
|
@@ -136,8 +136,6 @@ export async function getOptimalDecodedString(arr, options) {
|
|
|
136
136
|
? targetArr.filter(isIPv4)
|
|
137
137
|
: targetArr.filter((v) => !isIPv4(v));
|
|
138
138
|
}
|
|
139
|
-
if (!targetArr.length)
|
|
140
|
-
throw new Error("无可用地址");
|
|
141
139
|
const failedUrls = [];
|
|
142
140
|
const controllerMap = {};
|
|
143
141
|
return new Promise((resolve, reject) => {
|