From 8f3b6e1f670faad8fa2c15b525e8f95d58660b32 Mon Sep 17 00:00:00 2001 From: wood chen Date: Wed, 14 May 2025 00:46:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(Prices.vue):=20=E6=B7=BB=E5=8A=A0URL?= =?UTF-8?q?=E6=9C=89=E6=95=88=E6=80=A7=E6=A3=80=E6=9F=A5=E5=92=8C=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/Prices.vue | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/frontend/src/views/Prices.vue b/frontend/src/views/Prices.vue index 0996c5e..97e5681 100644 --- a/frontend/src/views/Prices.vue +++ b/frontend/src/views/Prices.vue @@ -656,6 +656,26 @@ const billingTypeMap = { const getStatus = (status) => statusMap[status] || status const getBillingType = (type) => billingTypeMap[type] || type +// 检查URL是否有效 +const isValidUrl = (url) => { + try { + new URL(url) + return true + } catch { + return false + } +} + +// 格式化URL以便显示 +const formatSourceUrl = (url) => { + try { + const urlObj = new URL(url) + return urlObj.hostname + (urlObj.pathname !== '/' ? urlObj.pathname : '') + } catch { + return url + } +} + // 复制模型名称到剪贴板 const copyModelName = (modelName) => { navigator.clipboard.writeText(modelName)