We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
源码和文档不对应 const KVe = (e, t) => { const n = t.toLowerCase(); return ["patch", "delete"].includes(n) ? { url: method/${n}/ + e, method: "POST" } : { url: e, method: t } } , qVe = (e, t) => { const n = el.parse(e.split("?")[1]) , r = Object.assign({}, n, t); return e.split("?")[0] + "?" + el.stringify(r, { arrayFormat: "repeat" }) } , GVe = async () => { if (window.uiauth && typeof window.uiauth == "function") { const e = await WVe(); return window.uiauth(e) } return "" } ; async function Jt(e, t="GET", n={}, r=!1) { Jet(e); const o = window.location.search , a = el.parse(o, { ignoreQueryPrefix: !0 }) || {} , s = Zet(a) , i = a.device_space || "" , u = await GVe() , l = KVe(e, t); e = l.url; const c = { method: l.method, headers: new Headers({ "pan-auth": u, "Device-Space": i, ...s }) }; if (r || (c.headers = new Headers({ "Content-Type": "application/json", "pan-auth": u, "Device-Space": i, ...s })), l.method.toLocaleLowerCase() !== "get" && l.method.toLocaleLowerCase() !== "head") { if (n.file) { c.headers = new Headers({ "pan-auth": u, "Device-Space": i, ...s }); const d = new FormData; d.append("file", n.file), d.append("pan-auth", u), c.body = d } else c.body = JSON.stringify(n || {}); e = qVe(e, { pan_auth: u, device_space: i }) } else { n.pan_auth = u || "", n.device_space = n.device_space ? n.device_space : i || ""; const d = el.stringify(n, { arrayFormat: "repeat" }); e = e + (d ? "?" + d : "") } try { const d = await fetch(e, c); if (d.ok) return r ? await d.blob() : await d.json(); if (r) { const p = await d.blob(); return Promise.reject(p) } try { const p = await d.json(); return Promise.reject(p) } catch { return Promise.reject(d) } } catch (d) { return d.error === "unreachable" && (d.error_description = "网络异常,请稍后重试"), Promise.reject(d) } }
method/${n}/
The text was updated successfully, but these errors were encountered:
新版本的xunlei的token已经存放在index.html中不需要手动获取#505,请更新xunlei镜像至最新版后重新试试
Sorry, something went wrong.
No branches or pull requests
Describe the bug
源码和文档不对应
const KVe = (e, t) => {
const n = t.toLowerCase();
return ["patch", "delete"].includes(n) ? {
url:
method/${n}/
+ e,method: "POST"
} : {
url: e,
method: t
}
}
, qVe = (e, t) => {
const n = el.parse(e.split("?")[1])
, r = Object.assign({}, n, t);
return e.split("?")[0] + "?" + el.stringify(r, {
arrayFormat: "repeat"
})
}
, GVe = async () => {
if (window.uiauth && typeof window.uiauth == "function") {
const e = await WVe();
return window.uiauth(e)
}
return ""
}
;
async function Jt(e, t="GET", n={}, r=!1) {
Jet(e);
const o = window.location.search
, a = el.parse(o, {
ignoreQueryPrefix: !0
}) || {}
, s = Zet(a)
, i = a.device_space || ""
, u = await GVe()
, l = KVe(e, t);
e = l.url;
const c = {
method: l.method,
headers: new Headers({
"pan-auth": u,
"Device-Space": i,
...s
})
};
if (r || (c.headers = new Headers({
"Content-Type": "application/json",
"pan-auth": u,
"Device-Space": i,
...s
})),
l.method.toLocaleLowerCase() !== "get" && l.method.toLocaleLowerCase() !== "head") {
if (n.file) {
c.headers = new Headers({
"pan-auth": u,
"Device-Space": i,
...s
});
const d = new FormData;
d.append("file", n.file),
d.append("pan-auth", u),
c.body = d
} else
c.body = JSON.stringify(n || {});
e = qVe(e, {
pan_auth: u,
device_space: i
})
} else {
n.pan_auth = u || "",
n.device_space = n.device_space ? n.device_space : i || "";
const d = el.stringify(n, {
arrayFormat: "repeat"
});
e = e + (d ? "?" + d : "")
}
try {
const d = await fetch(e, c);
if (d.ok)
return r ? await d.blob() : await d.json();
if (r) {
const p = await d.blob();
return Promise.reject(p)
}
try {
const p = await d.json();
return Promise.reject(p)
} catch {
return Promise.reject(d)
}
} catch (d) {
return d.error === "unreachable" && (d.error_description = "网络异常,请稍后重试"),
Promise.reject(d)
}
}
Describe the running environment
The text was updated successfully, but these errors were encountered: