@das-fed/utils 7.0.7-hot.20 → 7.0.7-hot.22
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/api-services/index.js +832 -841
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.js +749 -726
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +656 -647
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +750 -731
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +7 -2
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.js +745 -726
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +7 -2
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.js +756 -765
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +731 -744
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +7 -2
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +636 -635
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +750 -727
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +7 -2
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +7 -2
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +652 -651
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +758 -735
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js +627 -626
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +7 -2
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +7 -2
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +7 -2
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +749 -726
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +7 -2
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +731 -744
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +7 -2
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/getInfoFromUrl/index.js +36 -36
- package/common-info/getInfoFromUrl/index.js.gz +0 -0
- package/common-info/set-personal-info/index.js +49 -44
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-tools/extract-file-name/index.js +7 -2
- package/common-tools/extract-file-name/index.js.gz +0 -0
- package/create-api-service/index.js +7 -2
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/sso/authorizer.d.ts +1 -0
- package/create-api-service/sso/index.d.ts +2 -1
- package/create-api-service/sso/index.js +867 -795
- package/create-api-service/sso/index.js.gz +0 -0
- package/create-api-service/sso/utils.d.ts +2 -0
- package/curring-http/index.js +52 -47
- package/curring-http/index.js.gz +0 -0
- package/package.json +4 -4
- package/pinyin-first-character/index.js +1 -1
- package/pinyin-first-character/index.js.gz +0 -0
- package/webSocket-service/index.js +50 -40
- package/webSocket-service/index.js.gz +0 -0
|
Binary file
|
package/curring-http/index.js
CHANGED
|
@@ -71,9 +71,9 @@ function _e() {
|
|
|
71
71
|
arguments[r] && Z(arguments[r], n);
|
|
72
72
|
return t;
|
|
73
73
|
}
|
|
74
|
-
const
|
|
74
|
+
const On = (e, t, n, { allOwnKeys: r } = {}) => (Z(t, (o, s) => {
|
|
75
75
|
n && A(o) ? e[s] = ht(o, n) : e[s] = o;
|
|
76
|
-
}, { allOwnKeys: r }), e),
|
|
76
|
+
}, { allOwnKeys: r }), e), Sn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Tn = (e, t, n, r) => {
|
|
77
77
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
78
78
|
value: t.prototype
|
|
79
79
|
}), n && Object.assign(e.prototype, n);
|
|
@@ -170,14 +170,14 @@ const $n = (e) => {
|
|
|
170
170
|
return r;
|
|
171
171
|
};
|
|
172
172
|
return n(e, 0);
|
|
173
|
-
}, In = P("AsyncFunction"), qn = (e) => e && (X(e) || A(e)) && A(e.then) && A(e.catch),
|
|
173
|
+
}, In = P("AsyncFunction"), qn = (e) => e && (X(e) || A(e)) && A(e.then) && A(e.catch), Ot = ((e, t) => e ? setImmediate : t ? ((n, r) => (U.addEventListener("message", ({ source: o, data: s }) => {
|
|
174
174
|
o === U && s === n && r.length && r.shift()();
|
|
175
175
|
}, !1), (o) => {
|
|
176
176
|
r.push(o), U.postMessage(n, "*");
|
|
177
177
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
178
178
|
typeof setImmediate == "function",
|
|
179
179
|
A(U.postMessage)
|
|
180
|
-
), Mn = typeof queueMicrotask < "u" ? queueMicrotask.bind(U) : typeof process < "u" && process.nextTick ||
|
|
180
|
+
), Mn = typeof queueMicrotask < "u" ? queueMicrotask.bind(U) : typeof process < "u" && process.nextTick || Ot, Hn = (e) => e != null && A(e[ue]), a = {
|
|
181
181
|
isArray: I,
|
|
182
182
|
isArrayBuffer: yt,
|
|
183
183
|
isBuffer: G,
|
|
@@ -205,9 +205,9 @@ const $n = (e) => {
|
|
|
205
205
|
isFileList: dn,
|
|
206
206
|
forEach: Z,
|
|
207
207
|
merge: _e,
|
|
208
|
-
extend:
|
|
208
|
+
extend: On,
|
|
209
209
|
trim: En,
|
|
210
|
-
stripBOM:
|
|
210
|
+
stripBOM: Sn,
|
|
211
211
|
inherits: Tn,
|
|
212
212
|
toFlatObject: _n,
|
|
213
213
|
kindOf: le,
|
|
@@ -233,7 +233,7 @@ const $n = (e) => {
|
|
|
233
233
|
toJSONObject: $n,
|
|
234
234
|
isAsyncFn: In,
|
|
235
235
|
isThenable: qn,
|
|
236
|
-
setImmediate:
|
|
236
|
+
setImmediate: Ot,
|
|
237
237
|
asap: Mn,
|
|
238
238
|
isIterable: Hn
|
|
239
239
|
};
|
|
@@ -261,7 +261,7 @@ a.inherits(b, Error, {
|
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
|
-
const
|
|
264
|
+
const St = b.prototype, Tt = {};
|
|
265
265
|
[
|
|
266
266
|
"ERR_BAD_OPTION_VALUE",
|
|
267
267
|
"ERR_BAD_OPTION",
|
|
@@ -280,9 +280,9 @@ const Ot = b.prototype, Tt = {};
|
|
|
280
280
|
Tt[e] = { value: e };
|
|
281
281
|
});
|
|
282
282
|
Object.defineProperties(b, Tt);
|
|
283
|
-
Object.defineProperty(
|
|
283
|
+
Object.defineProperty(St, "isAxiosError", { value: !0 });
|
|
284
284
|
b.from = (e, t, n, r, o, s) => {
|
|
285
|
-
const i = Object.create(
|
|
285
|
+
const i = Object.create(St);
|
|
286
286
|
return a.toFlatObject(e, i, function(f) {
|
|
287
287
|
return f !== Error.prototype;
|
|
288
288
|
}, (c) => c !== "isAxiosError"), b.call(i, e.message, t, n, r, o), i.cause = e, i.name = e.name, s && Object.assign(i, s), i;
|
|
@@ -349,7 +349,7 @@ function de(e, t, n) {
|
|
|
349
349
|
convertValue: l,
|
|
350
350
|
isVisitable: Re
|
|
351
351
|
});
|
|
352
|
-
function
|
|
352
|
+
function S(h, y) {
|
|
353
353
|
if (!a.isUndefined(h)) {
|
|
354
354
|
if (d.indexOf(h) !== -1)
|
|
355
355
|
throw Error("Circular reference detected in " + y.join("."));
|
|
@@ -360,13 +360,13 @@ function de(e, t, n) {
|
|
|
360
360
|
a.isString(w) ? w.trim() : w,
|
|
361
361
|
y,
|
|
362
362
|
g
|
|
363
|
-
)) === !0 &&
|
|
363
|
+
)) === !0 && S(p, y ? y.concat(w) : [w]);
|
|
364
364
|
}), d.pop();
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
if (!a.isObject(e))
|
|
368
368
|
throw new TypeError("data must be an object");
|
|
369
|
-
return
|
|
369
|
+
return S(e), t;
|
|
370
370
|
}
|
|
371
371
|
function ke(e) {
|
|
372
372
|
const t = {
|
|
@@ -850,8 +850,8 @@ function dr(e, t) {
|
|
|
850
850
|
g += n[d++], d = d % e;
|
|
851
851
|
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), l - i < t)
|
|
852
852
|
return;
|
|
853
|
-
const
|
|
854
|
-
return
|
|
853
|
+
const S = u && l - u;
|
|
854
|
+
return S ? Math.round(g * 1e3 / S) : void 0;
|
|
855
855
|
};
|
|
856
856
|
}
|
|
857
857
|
function pr(e, t) {
|
|
@@ -1023,9 +1023,9 @@ const Nt = (e) => {
|
|
|
1023
1023
|
const o = Nt(e);
|
|
1024
1024
|
let s = o.data;
|
|
1025
1025
|
const i = x.from(o.headers).normalize();
|
|
1026
|
-
let { responseType: c, onUploadProgress: f, onDownloadProgress: l } = o, u, d, g,
|
|
1026
|
+
let { responseType: c, onUploadProgress: f, onDownloadProgress: l } = o, u, d, g, S, h;
|
|
1027
1027
|
function y() {
|
|
1028
|
-
|
|
1028
|
+
S && S(), h && h(), o.cancelToken && o.cancelToken.unsubscribe(u), o.signal && o.signal.removeEventListener("abort", u);
|
|
1029
1029
|
}
|
|
1030
1030
|
let m = new XMLHttpRequest();
|
|
1031
1031
|
m.open(o.method.toUpperCase(), o.url, !0), m.timeout = o.timeout;
|
|
@@ -1065,7 +1065,7 @@ const Nt = (e) => {
|
|
|
1065
1065
|
)), m = null;
|
|
1066
1066
|
}, s === void 0 && i.setContentType(null), "setRequestHeader" in m && a.forEach(i.toJSON(), function(C, R) {
|
|
1067
1067
|
m.setRequestHeader(R, C);
|
|
1068
|
-
}), a.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), c && c !== "json" && (m.responseType = o.responseType), l && ([g, h] = se(l, !0), m.addEventListener("progress", g)), f && m.upload && ([d,
|
|
1068
|
+
}), a.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), c && c !== "json" && (m.responseType = o.responseType), l && ([g, h] = se(l, !0), m.addEventListener("progress", g)), f && m.upload && ([d, S] = se(f), m.upload.addEventListener("progress", d), m.upload.addEventListener("loadend", S)), (o.cancelToken || o.signal) && (u = (E) => {
|
|
1069
1069
|
m && (r(!E || E.type ? new q(null, e, m) : E), m.abort(), m = null);
|
|
1070
1070
|
}, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u)));
|
|
1071
1071
|
const w = fr(o.url);
|
|
@@ -1098,7 +1098,7 @@ const Nt = (e) => {
|
|
|
1098
1098
|
const { signal: f } = r;
|
|
1099
1099
|
return f.unsubscribe = () => a.asap(c), f;
|
|
1100
1100
|
}
|
|
1101
|
-
},
|
|
1101
|
+
}, Or = function* (e, t) {
|
|
1102
1102
|
let n = e.byteLength;
|
|
1103
1103
|
if (n < t) {
|
|
1104
1104
|
yield e;
|
|
@@ -1107,9 +1107,9 @@ const Nt = (e) => {
|
|
|
1107
1107
|
let r = 0, o;
|
|
1108
1108
|
for (; r < n; )
|
|
1109
1109
|
o = r + t, yield e.slice(r, o), r = o;
|
|
1110
|
-
},
|
|
1110
|
+
}, Sr = async function* (e, t) {
|
|
1111
1111
|
for await (const n of Tr(e))
|
|
1112
|
-
yield*
|
|
1112
|
+
yield* Or(n, t);
|
|
1113
1113
|
}, Tr = async function* (e) {
|
|
1114
1114
|
if (e[Symbol.asyncIterator]) {
|
|
1115
1115
|
yield* e;
|
|
@@ -1127,7 +1127,7 @@ const Nt = (e) => {
|
|
|
1127
1127
|
await t.cancel();
|
|
1128
1128
|
}
|
|
1129
1129
|
}, Xe = (e, t, n, r) => {
|
|
1130
|
-
const o =
|
|
1130
|
+
const o = Sr(e, t);
|
|
1131
1131
|
let s = 0, i, c = (f) => {
|
|
1132
1132
|
i || (i = !0, r && r(f));
|
|
1133
1133
|
};
|
|
@@ -1214,9 +1214,9 @@ const Ar = async (e) => {
|
|
|
1214
1214
|
fetchOptions: g
|
|
1215
1215
|
} = Nt(e);
|
|
1216
1216
|
l = l ? (l + "").toLowerCase() : "text";
|
|
1217
|
-
let
|
|
1218
|
-
const y =
|
|
1219
|
-
|
|
1217
|
+
let S = Er([o, s && s.toAbortSignal()], i), h;
|
|
1218
|
+
const y = S && S.unsubscribe && (() => {
|
|
1219
|
+
S.unsubscribe();
|
|
1220
1220
|
});
|
|
1221
1221
|
let m;
|
|
1222
1222
|
try {
|
|
@@ -1238,7 +1238,7 @@ const Ar = async (e) => {
|
|
|
1238
1238
|
const p = "credentials" in Request.prototype;
|
|
1239
1239
|
h = new Request(t, {
|
|
1240
1240
|
...g,
|
|
1241
|
-
signal:
|
|
1241
|
+
signal: S,
|
|
1242
1242
|
method: n.toUpperCase(),
|
|
1243
1243
|
headers: u.normalize().toJSON(),
|
|
1244
1244
|
body: r,
|
|
@@ -1328,22 +1328,22 @@ const Qe = (e) => `- ${e}`, Pr = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1328
1328
|
},
|
|
1329
1329
|
adapters: Ce
|
|
1330
1330
|
};
|
|
1331
|
-
function
|
|
1331
|
+
function Oe(e) {
|
|
1332
1332
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1333
1333
|
throw new q(null, e);
|
|
1334
1334
|
}
|
|
1335
1335
|
function Ye(e) {
|
|
1336
|
-
return
|
|
1336
|
+
return Oe(e), e.headers = x.from(e.headers), e.data = Ee.call(
|
|
1337
1337
|
e,
|
|
1338
1338
|
e.transformRequest
|
|
1339
1339
|
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Dt.getAdapter(e.adapter || Q.adapter)(e).then(function(r) {
|
|
1340
|
-
return
|
|
1340
|
+
return Oe(e), r.data = Ee.call(
|
|
1341
1341
|
e,
|
|
1342
1342
|
e.transformResponse,
|
|
1343
1343
|
r
|
|
1344
1344
|
), r.headers = x.from(r.headers), r;
|
|
1345
1345
|
}, function(r) {
|
|
1346
|
-
return Pt(r) || (
|
|
1346
|
+
return Pt(r) || (Oe(e), r && r.response && (r.response.data = Ee.call(
|
|
1347
1347
|
e,
|
|
1348
1348
|
e.transformResponse,
|
|
1349
1349
|
r.response
|
|
@@ -1367,11 +1367,16 @@ he.transitional = function(t, n, r) {
|
|
|
1367
1367
|
o(i, " has been removed" + (n ? " in " + n : "")),
|
|
1368
1368
|
b.ERR_DEPRECATED
|
|
1369
1369
|
);
|
|
1370
|
-
return n && !et[i] && (et[i] = !0
|
|
1370
|
+
return n && !et[i] && (et[i] = !0, console.warn(
|
|
1371
|
+
o(
|
|
1372
|
+
i,
|
|
1373
|
+
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1374
|
+
)
|
|
1375
|
+
)), t ? t(s, i, c) : !0;
|
|
1371
1376
|
};
|
|
1372
1377
|
};
|
|
1373
1378
|
he.spelling = function(t) {
|
|
1374
|
-
return (n, r) => !0;
|
|
1379
|
+
return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
|
|
1375
1380
|
};
|
|
1376
1381
|
function vr(e, t, n) {
|
|
1377
1382
|
if (typeof e != "object")
|
|
@@ -1469,18 +1474,18 @@ let D = class {
|
|
|
1469
1474
|
return u;
|
|
1470
1475
|
}
|
|
1471
1476
|
g = c.length;
|
|
1472
|
-
let
|
|
1477
|
+
let S = n;
|
|
1473
1478
|
for (d = 0; d < g; ) {
|
|
1474
1479
|
const h = c[d++], y = c[d++];
|
|
1475
1480
|
try {
|
|
1476
|
-
|
|
1481
|
+
S = h(S);
|
|
1477
1482
|
} catch (m) {
|
|
1478
1483
|
y.call(this, m);
|
|
1479
1484
|
break;
|
|
1480
1485
|
}
|
|
1481
1486
|
}
|
|
1482
1487
|
try {
|
|
1483
|
-
u = Ye.call(this,
|
|
1488
|
+
u = Ye.call(this, S);
|
|
1484
1489
|
} catch (h) {
|
|
1485
1490
|
return Promise.reject(h);
|
|
1486
1491
|
}
|
|
@@ -1705,8 +1710,8 @@ const {
|
|
|
1705
1710
|
isAxiosError: gi,
|
|
1706
1711
|
spread: wi,
|
|
1707
1712
|
toFormData: Ei,
|
|
1708
|
-
AxiosHeaders:
|
|
1709
|
-
HttpStatusCode:
|
|
1713
|
+
AxiosHeaders: Oi,
|
|
1714
|
+
HttpStatusCode: Si,
|
|
1710
1715
|
formToJSON: Ti,
|
|
1711
1716
|
getAdapter: _i,
|
|
1712
1717
|
mergeConfig: Ri
|
|
@@ -1797,8 +1802,8 @@ function Be(e) {
|
|
|
1797
1802
|
var t = be(e);
|
|
1798
1803
|
return t == to || t == no || t == eo || t == ro;
|
|
1799
1804
|
}
|
|
1800
|
-
var
|
|
1801
|
-
var e = /[^.]+$/.exec(
|
|
1805
|
+
var Se = M["__core-js_shared__"], nt = function() {
|
|
1806
|
+
var e = /[^.]+$/.exec(Se && Se.keys && Se.keys.IE_PROTO || "");
|
|
1802
1807
|
return e ? "Symbol(src)_1." + e : "";
|
|
1803
1808
|
}();
|
|
1804
1809
|
function oo(e) {
|
|
@@ -1842,14 +1847,14 @@ function wo(e) {
|
|
|
1842
1847
|
var t = this.has(e) && delete this.__data__[e];
|
|
1843
1848
|
return this.size -= t ? 1 : 0, t;
|
|
1844
1849
|
}
|
|
1845
|
-
var Eo = "__lodash_hash_undefined__",
|
|
1850
|
+
var Eo = "__lodash_hash_undefined__", Oo = Object.prototype, So = Oo.hasOwnProperty;
|
|
1846
1851
|
function To(e) {
|
|
1847
1852
|
var t = this.__data__;
|
|
1848
1853
|
if (W) {
|
|
1849
1854
|
var n = t[e];
|
|
1850
1855
|
return n === Eo ? void 0 : n;
|
|
1851
1856
|
}
|
|
1852
|
-
return
|
|
1857
|
+
return So.call(t, e) ? t[e] : void 0;
|
|
1853
1858
|
}
|
|
1854
1859
|
var _o = Object.prototype, Ro = _o.hasOwnProperty;
|
|
1855
1860
|
function Ao(e) {
|
|
@@ -2042,11 +2047,11 @@ function as(e) {
|
|
|
2042
2047
|
var n = ss.call(t, "constructor") && t.constructor;
|
|
2043
2048
|
return typeof n == "function" && n instanceof n && Gt.call(n) == is;
|
|
2044
2049
|
}
|
|
2045
|
-
var cs = "[object Arguments]", us = "[object Array]", ls = "[object Boolean]", fs = "[object Date]", ds = "[object Error]", ps = "[object Function]", hs = "[object Map]", ms = "[object Number]", ys = "[object Object]", bs = "[object RegExp]", gs = "[object Set]", ws = "[object String]", Es = "[object WeakMap]",
|
|
2046
|
-
|
|
2047
|
-
|
|
2050
|
+
var cs = "[object Arguments]", us = "[object Array]", ls = "[object Boolean]", fs = "[object Date]", ds = "[object Error]", ps = "[object Function]", hs = "[object Map]", ms = "[object Number]", ys = "[object Object]", bs = "[object RegExp]", gs = "[object Set]", ws = "[object String]", Es = "[object WeakMap]", Os = "[object ArrayBuffer]", Ss = "[object DataView]", Ts = "[object Float32Array]", _s = "[object Float64Array]", Rs = "[object Int8Array]", As = "[object Int16Array]", xs = "[object Int32Array]", Cs = "[object Uint8Array]", Ps = "[object Uint8ClampedArray]", vs = "[object Uint16Array]", js = "[object Uint32Array]", O = {};
|
|
2051
|
+
O[Ts] = O[_s] = O[Rs] = O[As] = O[xs] = O[Cs] = O[Ps] = O[vs] = O[js] = !0;
|
|
2052
|
+
O[cs] = O[us] = O[Os] = O[ls] = O[Ss] = O[fs] = O[ds] = O[ps] = O[hs] = O[ms] = O[ys] = O[bs] = O[gs] = O[ws] = O[Es] = !1;
|
|
2048
2053
|
function Ns(e) {
|
|
2049
|
-
return Y(e) && Vt(e.length) && !!
|
|
2054
|
+
return Y(e) && Vt(e.length) && !!O[be(e)];
|
|
2050
2055
|
}
|
|
2051
2056
|
function Fs(e) {
|
|
2052
2057
|
return function(t) {
|
|
@@ -2128,8 +2133,8 @@ function Ws(e, t, n, r, o, s, i) {
|
|
|
2128
2133
|
}
|
|
2129
2134
|
var u = s ? s(c, f, n + "", e, t, i) : void 0, d = u === void 0;
|
|
2130
2135
|
if (d) {
|
|
2131
|
-
var g = Ne(f),
|
|
2132
|
-
u = f, g ||
|
|
2136
|
+
var g = Ne(f), S = !g && Wt(f), h = !g && !S && Zt(f);
|
|
2137
|
+
u = f, g || S || h ? Ne(c) ? u = c : Qo(c) ? u = zo(c) : S ? (d = !1, u = qo(f)) : h ? (d = !1, u = Ho(f)) : u = [] : as(f) || je(f) ? (u = c, je(c) ? u = Ks(c) : (!$(c) || Be(c)) && (u = Ko(f))) : d = !1;
|
|
2133
2138
|
}
|
|
2134
2139
|
d && (i.set(f, u), o(u, f, r, s, i), i.delete(f)), ve(e, n, u);
|
|
2135
2140
|
}
|
package/curring-http/index.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/utils",
|
|
3
|
-
"version": "7.0.7-hot.
|
|
3
|
+
"version": "7.0.7-hot.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@antv/x6": "^2.18.1",
|
|
12
|
-
"@das-fed/utils": "7.0.7-hot.
|
|
12
|
+
"@das-fed/utils": "7.0.7-hot.22",
|
|
13
13
|
"@vue/shared": "^3.4.21",
|
|
14
14
|
"@vueuse/core": "^9.6.0",
|
|
15
15
|
"axios": "^1.6.7",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"vue": "^3.4.21"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@das-fed/cli": "7.0.7-hot.
|
|
25
|
-
"@das-fed/web": "7.0.7-hot.
|
|
24
|
+
"@das-fed/cli": "7.0.7-hot.22",
|
|
25
|
+
"@das-fed/web": "7.0.7-hot.22",
|
|
26
26
|
"@types/js-cookie": "^3.0.6",
|
|
27
27
|
"@types/lodash-es": "^4.17.12",
|
|
28
28
|
"@types/qs": "^6.9.15",
|
|
@@ -23799,7 +23799,7 @@ const mn = new F(), pn = () => mn, r = (n) => {
|
|
|
23799
23799
|
return n.split(" ").forEach((u) => {
|
|
23800
23800
|
g.push(i ? u[0] : u);
|
|
23801
23801
|
}), g.join(" ");
|
|
23802
|
-
}, Sn = (n) => typeof n
|
|
23802
|
+
}, Sn = (n) => typeof n != "string" ? (console.error("The first param of pinyin is error: " + n + ' is not assignable to type "string".'), !1) : !0;
|
|
23803
23803
|
function p(n, i) {
|
|
23804
23804
|
return i instanceof RegExp ? i.test(n) : !0;
|
|
23805
23805
|
}
|
|
Binary file
|
|
@@ -1,60 +1,65 @@
|
|
|
1
1
|
import { getConfig as m } from "@das-fed/utils/config";
|
|
2
2
|
import { getToken as f } from "@das-fed/utils/common-info";
|
|
3
|
-
import { objectToUrlparams as
|
|
3
|
+
import { objectToUrlparams as w } from "@das-fed/utils/common-tools";
|
|
4
4
|
const c = m(), h = () => {
|
|
5
5
|
let s = "";
|
|
6
6
|
return c.baseURL ? s = c.baseURL : s = location.origin, s.replace("https://", "wss://").replace("http://", "ws://") || "";
|
|
7
|
-
},
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
},
|
|
7
|
+
}, b = (s, e = {}) => {
|
|
8
|
+
const t = w(e);
|
|
9
|
+
return t ? h() + s + `?${t}` : h() + s;
|
|
10
|
+
}, g = (s, e) => Math.floor(Math.random() * (e - s + 1)) + s;
|
|
11
11
|
class R {
|
|
12
12
|
constructor({
|
|
13
|
-
url:
|
|
14
|
-
params:
|
|
15
|
-
opened:
|
|
16
|
-
close:
|
|
17
|
-
error:
|
|
18
|
-
message:
|
|
19
|
-
ifReconnect:
|
|
20
|
-
reconnectNum:
|
|
13
|
+
url: e,
|
|
14
|
+
params: t = {},
|
|
15
|
+
opened: n,
|
|
16
|
+
close: r,
|
|
17
|
+
error: o,
|
|
18
|
+
message: i,
|
|
19
|
+
ifReconnect: l,
|
|
20
|
+
reconnectNum: a,
|
|
21
21
|
reconnectWhenClose: u
|
|
22
22
|
}) {
|
|
23
|
-
if (this.$ws = null, this.url = "", this.params = {}, this.lockReturn = !1, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = !0, this.reconnectId = null, this.reconnectNum = 3, this.reconnectWhenClose = !1, this.currentReconnectNum = 0, this.$ws = null, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect =
|
|
24
|
-
this.url =
|
|
23
|
+
if (this.$ws = null, this.url = "", this.params = {}, this.lockReturn = !1, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = !0, this.reconnectId = null, this.reconnectNum = 3, this.reconnectWhenClose = !1, this.currentReconnectNum = 0, this.$ws = null, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = l ?? !0, this.reconnectNum = a ?? 3, this.reconnectWhenClose = u ?? !1, this.lockReturn = !1, this.currentReconnectNum = 0, this.reconnectId = null, this.params = { ...t, access_token: f() }, e)
|
|
24
|
+
this.url = e;
|
|
25
25
|
else
|
|
26
26
|
throw new Error("url is required");
|
|
27
|
-
|
|
27
|
+
n && (this.opened = n), r && (this.close = r), o && (this.error = o), i && (this.afterMsg = i), this.initWebSocket();
|
|
28
28
|
}
|
|
29
29
|
initWebSocket() {
|
|
30
30
|
if (typeof WebSocket > "u") throw new Error("您的浏览器不支持websocket");
|
|
31
|
-
const
|
|
32
|
-
this.$ws = new WebSocket(
|
|
31
|
+
const e = b(this.url, this.params);
|
|
32
|
+
this.$ws = new WebSocket(e), this.$ws.onopen = () => {
|
|
33
33
|
this.open();
|
|
34
|
-
}, this.$ws.onclose = (
|
|
35
|
-
this.close(
|
|
36
|
-
}, this.$ws.onmessage = (
|
|
37
|
-
this.message(
|
|
38
|
-
}, this.$ws.onerror = (
|
|
39
|
-
this.error(
|
|
34
|
+
}, this.$ws.onclose = (t) => {
|
|
35
|
+
this.close(t);
|
|
36
|
+
}, this.$ws.onmessage = (t) => {
|
|
37
|
+
this.message(t);
|
|
38
|
+
}, this.$ws.onerror = (t) => {
|
|
39
|
+
this.error(t);
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
open() {
|
|
43
|
-
this.currentReconnectNum = 0, this.startTime = (/* @__PURE__ */ new Date()).getTime(), this.opened(this.$ws), this.startHeartbeat();
|
|
43
|
+
this.currentReconnectNum = 0, this.startTime = (/* @__PURE__ */ new Date()).getTime(), this.opened(this.$ws), this.startHeartbeat(), console.log(this.url + " =>websocket连接成功,可以开始通讯");
|
|
44
44
|
}
|
|
45
|
-
opened(
|
|
45
|
+
opened(e) {
|
|
46
|
+
console.log(this.url + " =>websocket连接已打开:", e);
|
|
46
47
|
}
|
|
47
|
-
close(
|
|
48
|
-
this.$ws.readyState === WebSocket.CLOSED
|
|
48
|
+
close(e) {
|
|
49
|
+
if (this.$ws.readyState === WebSocket.CLOSED) {
|
|
50
|
+
const t = (/* @__PURE__ */ new Date()).getTime();
|
|
51
|
+
this.reconnectWhenClose && this.reconnect(), clearInterval(this.heartbeatInterval), console.log(`${this.url}=>WebSocket连接已经关闭,连接总时长: ${t - this.startTime}ms`);
|
|
52
|
+
}
|
|
49
53
|
}
|
|
50
|
-
message(
|
|
51
|
-
const
|
|
52
|
-
this.afterMsg(
|
|
54
|
+
message(e) {
|
|
55
|
+
const t = typeof e.data == "object" ? e.data : JSON.parse(e.data);
|
|
56
|
+
this.afterMsg(t);
|
|
53
57
|
}
|
|
54
|
-
afterMsg(
|
|
58
|
+
afterMsg(e) {
|
|
59
|
+
console.log(this.url + " =>接收到websocket的消息:", e);
|
|
55
60
|
}
|
|
56
|
-
error(
|
|
57
|
-
return this.ifReconnect && this.reconnect(),
|
|
61
|
+
error(e) {
|
|
62
|
+
return this.ifReconnect && this.reconnect(), e;
|
|
58
63
|
}
|
|
59
64
|
/** websocket重连 */
|
|
60
65
|
reconnect() {
|
|
@@ -63,19 +68,24 @@ class R {
|
|
|
63
68
|
}, 3e3)));
|
|
64
69
|
}
|
|
65
70
|
/** 发送消息给服务器 */
|
|
66
|
-
send(
|
|
67
|
-
var
|
|
68
|
-
((
|
|
71
|
+
send(e) {
|
|
72
|
+
var t;
|
|
73
|
+
if (((t = this.$ws) == null ? void 0 : t.readyState) !== WebSocket.OPEN) {
|
|
74
|
+
console.log(this.url + "=>websocket连接未建立,还不能发送消息");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
this.$ws.send(e);
|
|
69
78
|
}
|
|
70
79
|
// 启动心跳检测==>30s-5分钟内随机发一次心跳保持会话(时间区间内随机是为了降低突增流量的概率)
|
|
71
80
|
startHeartbeat() {
|
|
72
81
|
this.heartbeatInterval = setInterval(() => {
|
|
73
|
-
|
|
74
|
-
|
|
82
|
+
const e = "";
|
|
83
|
+
this.send(e), console.log(this.url + "=>心跳检测发送消息:", e);
|
|
84
|
+
}, g(3e4, 3e5));
|
|
75
85
|
}
|
|
76
86
|
/** 断开连接 */
|
|
77
87
|
disconnect() {
|
|
78
|
-
this.$ws.close();
|
|
88
|
+
this.$ws.close(), console.log(this.url + " =>主动断开websocket连接");
|
|
79
89
|
}
|
|
80
90
|
}
|
|
81
91
|
export {
|
|
Binary file
|