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 @@ - +