mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-08 07:26:47 +00:00
@@ -67,13 +67,10 @@ const mapImgUrl = (img, block, type = 'block', from) => {
|
|||||||
ret = BLOG.NOTION_HOST + '/image/' + encodeURIComponent(ret) + '?table=' + type + '&id=' + block.id
|
ret = BLOG.NOTION_HOST + '/image/' + encodeURIComponent(ret) + '?table=' + type + '&id=' + block.id
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnSplash 随机图片接口优化
|
// 随机图片接口优化 防止因url一致而随机结果相同
|
||||||
if (ret.includes('source.unsplash.com/random')) {
|
const separator = ret.includes('?') ? '&' : '?'
|
||||||
// 检查原始URL是否已经包含参数
|
// 拼接唯一识别参数,防止请求的图片被缓存
|
||||||
const separator = ret.includes('?') ? '&' : '?'
|
ret = `${ret.trim()}${separator}t=${block.id}`
|
||||||
// 拼接唯一识别参数,防止请求的图片被缓存
|
|
||||||
ret = `${ret}${separator}random=${block.id}`
|
|
||||||
}
|
|
||||||
|
|
||||||
// 文章封面
|
// 文章封面
|
||||||
if (from === 'pageCoverThumbnail') {
|
if (from === 'pageCoverThumbnail') {
|
||||||
|
|||||||
Reference in New Issue
Block a user