From ead4078079a71bbef43ffc22a7ea7fb0f4039bf0 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期五, 28 十一月 2025 17:36:28 +0800
Subject: [PATCH] fix: bug

---
 src/utils/request/common.ts |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/utils/request/common.ts b/src/utils/request/common.ts
new file mode 100644
index 0000000..b734c36
--- /dev/null
+++ b/src/utils/request/common.ts
@@ -0,0 +1,13 @@
+import cryptoJs from 'crypto-js';
+
+const ApiSignPrivateKey = 'X07uIM2cHK5IJhDi4ppoxQglYE21gq3E';
+
+export function getTimestampInSeconds() {
+  var date = new Date();
+  var timestampInSeconds = Math.floor(date.getTime() / 1000);
+  return timestampInSeconds;
+}
+
+export function generateApiSign(token: string, userId: string, timestampInSeconds: number) {
+  return cryptoJs.MD5(`${token}-${userId}-${timestampInSeconds}-${ApiSignPrivateKey}`).toString();
+}

--
Gitblit v1.9.1