Merge branch 'main' into fix/Aplayer-url-404

This commit is contained in:
tangly1024
2025-07-27 21:03:59 +08:00
committed by GitHub

View File

@@ -119,10 +119,19 @@ const compressImage = (image, width, quality = 50, fmt = 'webp') => {
width = siteConfig('IMAGE_COMPRESS_WIDTH') width = siteConfig('IMAGE_COMPRESS_WIDTH')
} }
// 将URL解析为一个对象
const urlObj = new URL(image) let urlObj
// 获取URL参数 let params
const params = new URLSearchParams(urlObj.search) 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图床 // Notion图床
if ( if (