mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
Merge branch 'main' into fix/Aplayer-url-404
This commit is contained in:
@@ -119,10 +119,19 @@ const compressImage = (image, width, quality = 50, fmt = 'webp') => {
|
||||
width = siteConfig('IMAGE_COMPRESS_WIDTH')
|
||||
}
|
||||
|
||||
// 将URL解析为一个对象
|
||||
const urlObj = new URL(image)
|
||||
// 获取URL参数
|
||||
const params = new URLSearchParams(urlObj.search)
|
||||
|
||||
let urlObj
|
||||
let params
|
||||
try {
|
||||
// 将URL解析为一个对象
|
||||
urlObj = new URL(image)
|
||||
// 获取URL参数
|
||||
params = new URLSearchParams(urlObj.search)
|
||||
} catch (err) {
|
||||
// 捕获异常并打印错误的url
|
||||
console.error('compressImage: Invalid URL:', image, err)
|
||||
return image
|
||||
}
|
||||
|
||||
// Notion图床
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user