修复朋友圈图片正则匹配

This commit is contained in:
cc
2026-05-23 09:58:04 +08:00
parent 628bcdd90a
commit 5f8b27de80

View File

@@ -131,7 +131,7 @@ const fixSnsUrl = (url: string, token?: string, isVideo: boolean = false) => {
// 只有非视频(即图片)才需要处理路径末尾的尺寸标识(/150、/200等变为 /0
if (!isVideo) {
const [pathPart, queryPart] = fixedUrl.split('?')
const fixedPath = pathPart.replace(/\/\d+$/, '/0')
const fixedPath = pathPart.replace(/\/(150|200|480)($|\?)/, '/0$2')
fixedUrl = queryPart ? `${fixedPath}?${queryPart}` : fixedPath
}