v0.9.9
This commit is contained in:
parent
d32e92509c
commit
0a688d3d9f
6
dist/ff-request.js
vendored
6
dist/ff-request.js
vendored
@ -417,7 +417,7 @@ class Z {
|
|||||||
A(this, "request", ({ url: e = "/", method: r = "GET", ...n }, u = !1) => {
|
A(this, "request", ({ url: e = "/", method: r = "GET", ...n }, u = !1) => {
|
||||||
var x;
|
var x;
|
||||||
const v = r.toUpperCase(), c = de(JSON.stringify([e, v, n])), U = (x = e == null ? void 0 : e.includes) != null && x.call(e, "/_/") ? "#" : "$", { promise: B, resolve: D, reject: q } = Promise.withResolvers();
|
const v = r.toUpperCase(), c = de(JSON.stringify([e, v, n])), U = (x = e == null ? void 0 : e.includes) != null && x.call(e, "/_/") ? "#" : "$", { promise: B, resolve: D, reject: q } = Promise.withResolvers();
|
||||||
return h(this, m)[U].has(c) ? (console.log("缓存命中", e), D(h(this, m)[U].get(c))) : h(this, $).has(c) ? h(this, $).get(c).push([D, q]) : h(this, $).set(c, [[D, q]]), h(this, $).get(c).length === 1 && h(this, F).call(this, { url: e, method: v, ...n }).then((p) => {
|
return h(this, m)[U].has(c) ? (console.log("缓存命中", e), D(h(this, m)[U].get(c))) : h(this, $).has(c) ? h(this, $).get(c).push([D, q]) : (h(this, $).set(c, [[D, q]]), h(this, F).call(this, { url: e, method: v, ...n }).then((p) => {
|
||||||
if (![0, 1].includes(p.code))
|
if (![0, 1].includes(p.code))
|
||||||
throw W(p.code, p.msg, p.data, e, p == null ? void 0 : p.res);
|
throw W(p.code, p.msg, p.data, e, p == null ? void 0 : p.res);
|
||||||
return [p.code, p.msg, p.data, e, p == null ? void 0 : p.res];
|
return [p.code, p.msg, p.data, e, p == null ? void 0 : p.res];
|
||||||
@ -428,8 +428,8 @@ class Z {
|
|||||||
i && i[1](p instanceof X ? p : W(-1, p, null, e)), delete s[a];
|
i && i[1](p instanceof X ? p : W(-1, p, null, e)), delete s[a];
|
||||||
});
|
});
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
console.log(1111, h(this, $).get(c));
|
console.log(1111, h(this, $).get(c)), h(this, $).delete(c);
|
||||||
}), new Proxy(B, {
|
})), new Proxy(B, {
|
||||||
get: (p, i) => (...a) => p.then((s) => W(...s)[i](...a)).catch((s) => {
|
get: (p, i) => (...a) => p.then((s) => W(...s)[i](...a)).catch((s) => {
|
||||||
if (!s instanceof X)
|
if (!s instanceof X)
|
||||||
throw s;
|
throw s;
|
||||||
|
2
dist/ff-request.umd.cjs
vendored
2
dist/ff-request.umd.cjs
vendored
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ff-request",
|
"name": "ff-request",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.9.8",
|
"version": "0.9.9",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
Loading…
Reference in New Issue
Block a user