From 310a6994710d994e8523c3c227c90341cd061a0f Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 27 Jun 2023 15:44:02 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2933=20fix=EF=BC=9A=E6=B7=BB=E5=8A=A0mac?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E7=9A=84=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/common/js/validate.js | 12 ++++++++++++ .../src/components/common/rightBox/ipDetailsBox.vue | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/nezha-fronted/src/components/common/js/validate.js b/nezha-fronted/src/components/common/js/validate.js index b9fe266ef..7fa537fc6 100644 --- a/nezha-fronted/src/components/common/js/validate.js +++ b/nezha-fronted/src/components/common/js/validate.js @@ -293,3 +293,15 @@ export function maxHopsValidator (rule, value, callback) { } }, 100) } +// 验证mac地址 +export function validateMAC (rule, value, callback) { + const macRule = /^([0-9a-fA-F]{2}(:|-)){5}[0-9a-fA-F]{2}$/ + setTimeout(() => { + if (value == '') return callback() + if (macRule.test(value)) { + callback() + } else { + callback(new Error(vm.$t('validate.macError'))) + } + }, 100) +} diff --git a/nezha-fronted/src/components/common/rightBox/ipDetailsBox.vue b/nezha-fronted/src/components/common/rightBox/ipDetailsBox.vue index 38736181c..7622e24d1 100644 --- a/nezha-fronted/src/components/common/rightBox/ipDetailsBox.vue +++ b/nezha-fronted/src/components/common/rightBox/ipDetailsBox.vue @@ -53,6 +53,7 @@