From 6042333b76aaf8097271348ec56fad019a685c84 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期三, 25 九月 2024 15:56:11 +0800
Subject: [PATCH] feat:线上端口号更改

---
 utils/util.js |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/utils/util.js b/utils/util.js
index f9b67d7..465140a 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -1,4 +1,4 @@
-export function todayDate(arg){
+export function todayDate(arg) {
 	let date = new Date()
 	let year = date.getFullYear()
 	let month = date.getMonth() + 1;
@@ -6,11 +6,29 @@
 	let hour = date.getHours()
 	let minutes = date.getMinutes()
 	let seconds = date.getSeconds()
-	console.log(arg,'鏃堕棿');
-	if(arg == 'hms'){
+	if (arg == 'hms') {
 		hour = hour < 10 ? '0' + hour : hour
 		minutes = minutes < 10 ? '0' + minutes : minutes
 		seconds = seconds < 10 ? '0' + seconds : seconds
-		return hour+':'+minutes+':' + seconds
+		return hour + ':' + minutes + ':' + seconds
 	}
-}
\ No newline at end of file
+}
+
+export const Debounce = (fn, wait) => {
+    let delay = wait|| 500
+    let timer
+    return function () {
+        let args = arguments;
+        if (timer) {
+            clearTimeout(timer)
+        }
+
+        let callNow = !timer
+
+        timer = setTimeout(() => {
+            timer = null
+        }, delay)
+
+        if (callNow) fn.apply(this, args)
+    }
+}

--
Gitblit v1.9.1