-
Notifications
You must be signed in to change notification settings - Fork 1
[Feature Request] 自己造图床 #432
Comments
@langningchen SEO修好了! |
可以用团队的repo @langningchen 物尽其用 |
@PythonSmall-Q 原来不是试过了不太行吗?好像对于权限管理不太好弄 |
@boomzero @PythonSmall-Q 你们到时候可别去 Cloudflare 后台偷我的 PAT 啊!不过我也只给 repo 权限 😆 |
|
好麻烦啊!Workers流量的问题、GitHub权限的问题、JS前端事件触发的问题……让我不想继续了 |
考虑Cloudflare R2? |
但是没有credit card, 而且免费额度可能不够 |
或者iframe 洛谷图床 |
@boomzero 最主要的是JS前端事件触发的问题 |
@boomzero 帮我解决一下JS前端事件触发的问题 |
什么问题?
… On Sep 24, 2023, at 09:24, Chen LangNing ***@***.***> wrote:
@boomzero <https://github.com/boomzero> 帮我解决一下JS前端事件触发的问题 /help-wanted
—
Reply to this email directly, view it on GitHub <#432 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AULMJZJJ4UMZUNDVMO67ANDX36DUZANCNFSM6AAAAAA43Q7PBY>.
You are receiving this because you were mentioned.
|
@boomzero 就是按了 Ctrl+V 无法触发 |
右键点粘贴也不行 |
这个actions太贴心了qaq |
有点被他暖到(不是 |
@langningchen 我没有code啊 |
神奇 |
不过获取到的不太对 |
我说过了:#432 (comment) |
我检查过, GitHub Rest API 返回的内容没有错,是用 Curl 检查的 curl "https://api.github.com/repos/langningchen/XMOJ-Script-Pictures/contents/rptzrfmpxufetajrvzeccnwqlsesbgmp" \
-H"Authorization: Bearer ***" \
-H"User-Agent: XMOJ-Script-Server" \
-H"Accept: application/vnd.github.raw" \
--output /mnt/c/Users/jpxx_/OneDrive/Desktop/API.png
diff /mnt/c/Users/jpxx_/OneDrive/Desktop/Raw.png /mnt/c/Users/jpxx_/OneDrive/Desktop/API.png |
所以不是上传的错误 |
我又试了试不用 Curl ,用 JS 的 Fetch let ImageData = await fetch(new URL("https://api.github.com/repos/langningchen/XMOJ-Script-Pictures/contents/ggqzbaghexjxuzwyzvteioeejlouqtcw"), {
method: "GET",
headers: {
"Authorization": "Bearer ***",
"Accept": "application/vnd.github.text",
"User-Agent": "XMOJ-Script-Server"
}
}).then((Response) => {
return Response.text();
});
let a = document.createElement("a");
a.href = URL.createObjectURL(new Blob([ImageData], { type: "image/png" }));
a.download = "Fetch.png";
a.click(); diff Error.png Fetch.png 结果发现 Fetch 得到的和错误的一样,所以 |
现在准备用 XMLHttpRequest |
还是不行…… |
加油做模拟赛! |
我看你们二老还没交题欸~ |
|
用 Curl 和 Github API 获取到的是对的,和正确的一样,但是使用 fetch 或者 XMLHttpRequest 获取到的就有个别字符是错的,是不是字符编码的问题? |
做了点题,结果发现状态不在都做不出来qwq |
@PythonSmall-Q 那就来帮我解决问题吧 |
经查询, |
@boomzero @PythonSmall-Q 有什么思路吗?我现在准备去网上问一问 |
@boomzero @PythonSmall-Q Horray! |
StackOverflow users give me the answer! 🎉 |
@boomzero @PythonSmall-Q 你们快去试试吧! |
@boomzero 解决了,问题就删了 |
检查项
描述
使用 GitHub 私有仓库 + Cloudflare Workers ,参考 这篇 文章
原因
No response
The text was updated successfully, but these errors were encountered: