From 60ebb5f4610ce79742a3781c71f7eda4043b7fac Mon Sep 17 00:00:00 2001
From: hdy <1105738590@qq.com>
Date: 星期一, 08 一月 2024 20:16:31 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 jcdm-ui/src/main.js |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/jcdm-ui/src/main.js b/jcdm-ui/src/main.js
index c9f70f1..aea3622 100644
--- a/jcdm-ui/src/main.js
+++ b/jcdm-ui/src/main.js
@@ -85,3 +85,19 @@
   store,
   render: h => h(App)
 })
+//ip楠岃瘉
+Vue.directive('ipAddressValidator', {
+  bind(el, binding, vnode) {
+    el.addEventListener('input', () => {
+      const value = el.value;
+      // IPv4 address validation
+      if (/^((\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])(\.((\d{1,2}|1\d{2}|2[0-4]\d|25[0-5]))){3})$/.test(value)) {
+        console.log("Valid IPv4 Address");
+      } else if (!/(^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$)|(^(?:(?:[\x00-\x7F]|[\u0391-\uFFEF])+)(?:\.[a-zA-Z0-9]+)*$)/i.test(value)) {
+        console.log("Invalid IPv4 or IPv6 Address");
+      } else {
+        console.log("Valid IPv6 Address");
+      }
+    });
+  },
+});

--
Gitblit v1.9.3