This commit is contained in:
what 2024-05-25 22:47:20 +08:00
parent d32e92509c
commit 0a688d3d9f
3 changed files with 5 additions and 5 deletions

6
dist/ff-request.js vendored
View File

@ -417,7 +417,7 @@ class Z {
A(this, "request", ({ url: e = "/", method: r = "GET", ...n }, u = !1) => {
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();
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))
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];
@ -428,8 +428,8 @@ class Z {
i && i[1](p instanceof X ? p : W(-1, p, null, e)), delete s[a];
});
}).finally(() => {
console.log(1111, h(this, $).get(c));
}), new Proxy(B, {
console.log(1111, h(this, $).get(c)), h(this, $).delete(c);
})), new Proxy(B, {
get: (p, i) => (...a) => p.then((s) => W(...s)[i](...a)).catch((s) => {
if (!s instanceof X)
throw s;

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{
"name": "ff-request",
"private": true,
"version": "0.9.8",
"version": "0.9.9",
"type": "module",
"files": [
"dist"