Skip to content

Commit

Permalink
per:暗色优化 && feat:文本分享支持pdf/png导出
Browse files Browse the repository at this point in the history
  • Loading branch information
ling-drag0n authored Dec 23, 2024
1 parent c6d4846 commit 24b85e6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6577,6 +6577,24 @@ async function handlePaste(request, env) {
}
}

// 检查是否存在于文件分享中 - 只在 FILE_STORE 存在时检查
if (env.FILE_STORE) {
const existingFile = await env.FILE_STORE.get(customId);
if (existingFile) {
return new Response(
JSON.stringify({
message: "该链接后缀已被用于文件分享,请更换一个",
status: "error",
usedBy: "file",
}),
{
status: 400,
headers: { "Content-Type": "application/json" },
}
);
}
}

const id = customId || utils.generateId();
const paste = {
content,
Expand Down

0 comments on commit 24b85e6

Please sign in to comment.