From e7b0b34176549cfec809c6b89c4cab0999e488b9 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期二, 28 三月 2023 16:40:56 +0800
Subject: [PATCH] 修改大部分问题

---
 utils/util.js |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/utils/util.js b/utils/util.js
index f5e9768..7285440 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -1,7 +1,15 @@
-export function todayDate(){
+export function todayDate(arg) {
 	let date = new Date()
 	let year = date.getFullYear()
 	let month = date.getMonth() + 1;
 	let day = date.getDate()
-	return year + '-' + month + '-' + day
-}
\ No newline at end of file
+	let hour = date.getHours()
+	let minutes = date.getMinutes()
+	let seconds = date.getSeconds()
+	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
+	}
+}

--
Gitblit v1.9.1