mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-13 23:16:47 +00:00
fix: 兼容旧的 AWS 链接格式以确保旧文件正常加载
This commit is contained in:
@@ -139,12 +139,10 @@ function convertNotionBlocksToPost(id, blockMap, slice) {
|
||||
|
||||
// 如果是文件,或嵌入式PDF,需要重新加密签名
|
||||
if (
|
||||
(b?.value?.type === 'file' ||
|
||||
b?.value?.type === 'pdf' ||
|
||||
b?.value?.type === 'video' ||
|
||||
b?.value?.type === 'audio') &&
|
||||
['file', 'pdf', 'video', 'audio'].includes(b?.value?.type) &&
|
||||
b?.value?.properties?.source?.[0][0] &&
|
||||
b?.value?.properties?.source?.[0][0].indexOf('attachment') === 0
|
||||
(b?.value?.properties?.source?.[0][0].indexOf('attachment') === 0 ||
|
||||
b?.value?.properties?.source?.[0][0].indexOf('amazonaws.com') > 0)
|
||||
) {
|
||||
const oldUrl = b?.value?.properties?.source?.[0][0]
|
||||
const newUrl = `https://notion.so/signed/${encodeURIComponent(oldUrl)}?table=block&id=${b?.value?.id}`
|
||||
|
||||
Reference in New Issue
Block a user