feat: 系统消息如果是一个链接则直接跳转

This commit is contained in:
2026-04-15 13:16:35 +08:00
parent 8a9e7205eb
commit f56718e93a
2 changed files with 21 additions and 2 deletions

View File

@@ -672,6 +672,17 @@ function sketchToMask(sketchImage) {
img.src = sketchImage;
});
}
function isValidUrl(string) {
try {
const url = new URL(string)
// 通常我们只需要 http 或 https 协议
return url.protocol === "http:" || url.protocol === "https:"
} catch (err) {
return false
}
}
export {
isEmail,
getUploadUrl,
@@ -695,5 +706,6 @@ export {
calculateGradientCoordinate,
segmentImage,
UrlToFile,
sketchToMask
sketchToMask,
isValidUrl
}