From 8d9b21e4a29f9031942a3febe04d2c8ce2f81ff6 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Mon, 6 Nov 2023 20:11:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=8F=8D=E4=BB=A3?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#2821)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/utils/util.ts | 12 ++++++++++++ .../website/config/basic/proxy/create/index.vue | 15 ++++++++++++++- .../website/config/safety/value-list/index.vue | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils/util.ts b/frontend/src/utils/util.ts index 4aed097b6..1c3ede1d7 100644 --- a/frontend/src/utils/util.ts +++ b/frontend/src/utils/util.ts @@ -208,6 +208,18 @@ export function checkDomain(value: string): boolean { } } +export function isDomain(value: string): boolean { + if (value === '') { + return true; + } + const reg = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$/i; + if (value !== '' && reg.test(value)) { + return true; + } else { + return false; + } +} + export function checkIpV4V6(value: string): boolean { if (value === '') { return true; diff --git a/frontend/src/views/website/website/config/basic/proxy/create/index.vue b/frontend/src/views/website/website/config/basic/proxy/create/index.vue index 11a1a4350..61fe29e19 100644 --- a/frontend/src/views/website/website/config/basic/proxy/create/index.vue +++ b/frontend/src/views/website/website/config/basic/proxy/create/index.vue @@ -38,7 +38,11 @@ - +