Skip to content

Commit

Permalink
sync with main repo
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Oct 11, 2024
1 parent 726fcc0 commit 1259311
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1716,8 +1716,14 @@
const currentPage = paginatedUpFileList[pageIndex];
sendRequest(
window.api.method,
window.api.url + '?upload=' + odPath,
JSON.stringify({ secret: window.fileCache.get(`${odPath}/.upload`) || '', files: currentPage }),
window.api.url + '?upload',
window.api.formatPayload(
odPath,
window.fileCache.get(`${odPath}/.upload`) || '',
{
files: currentPage,
}
),
window.api.headers,
(response) => {
const uploadLinks = JSON.parse(response).files;
Expand Down Expand Up @@ -1863,23 +1869,15 @@
root: '/',
url: window.GLOBAL_CONFIG.SCF_GATEWAY,
method: 'POST',
formatPayload: (path, passwd) => {
const payload = {
formatPayload: (path, passwd, kvs) =>
JSON.stringify({
path,
passwd,
...window.api.accessToken,
};
const form = new URLSearchParams();
for (const k in payload) {
const v = payload[k];
if (v) {
form.append(k, v);
}
}
return `?${form.toString()}`;
},
...kvs,
}),
headers: {
'Content-type': 'application/x-www-form-urlencoded',
'Content-type': 'application/json; charset=utf-8',
},
};
window.backFordwardCache = {
Expand All @@ -1896,10 +1894,6 @@
new URLSearchParams(window.location.search).get('path') ||
window.api.root;
if (window.GLOBAL_CONFIG.IS_CF) {
window.api.accessToken = {
encrypted: '',
plain: '',
};
fetchFileList(initialPath);
addBackForwardListener();
addFileUploadListener();
Expand Down

0 comments on commit 1259311

Please sign in to comment.