From ef0a386e907faa376584ad1e331a431ef3541f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=9F=E6=9D=90?= Date: Thu, 13 Nov 2025 00:54:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlark=E7=AD=BE=E5=90=8D?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/core/notifier/providers/larkbot/larkbot.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/core/notifier/providers/larkbot/larkbot.go b/pkg/core/notifier/providers/larkbot/larkbot.go index 15db010d..5bd8f7c4 100644 --- a/pkg/core/notifier/providers/larkbot/larkbot.go +++ b/pkg/core/notifier/providers/larkbot/larkbot.go @@ -75,10 +75,17 @@ func (n *NotifierProvider) Notify(ctx context.Context, subject string, message s }, } if n.config.Secret != "" { - timestamp := fmt.Sprintf("%d", time.Now().UnixMilli()) + timestamp := fmt.Sprintf("%d", time.Now().Unix()) - h := hmac.New(sha256.New, []byte(n.config.Secret)) - h.Write([]byte(fmt.Sprintf("%s\n%s", timestamp, n.config.Secret))) + // timestamp + key 做sha256, 再进行base64 encode + stringToSign := fmt.Sprintf("%s\n%s", timestamp, n.config.Secret) + + h := hmac.New(sha256.New, []byte(stringToSign)) + var data []byte + _, err := h.Write(data) + if err != nil { + return nil, fmt.Errorf("lark api error: failed to calc sign: %w", err) + } sign := base64.StdEncoding.EncodeToString(h.Sum(nil)) payload["timestamp"] = timestamp From 45d9a00b03166b2b456f1f7f7067fb547b6f9035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=9F=E6=9D=90?= Date: Thu, 13 Nov 2025 00:56:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=97=B6=E4=BE=9D=E8=B5=96dayjs=E5=92=8Creac?= =?UTF-8?q?t-router?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/package.json b/ui/package.json index 949649b3..4cf780e7 100644 --- a/ui/package.json +++ b/ui/package.json @@ -25,6 +25,7 @@ "antd-zod": "^7.0.0", "clsx": "^2.1.1", "cron-parser": "^5.4.0", + "dayjs": "^1.11.19", "file-saver": "^2.0.5", "i18next": "^25.6.2", "i18next-browser-languagedetector": "^8.2.0", @@ -36,6 +37,7 @@ "react-copy-to-clipboard": "^5.1.0", "react-dom": "^18.3.1", "react-i18next": "^16.2.4", + "react-router": "^7.9.5", "react-router-dom": "^7.9.5", "tailwind-merge": "^3.4.0", "yaml": "^2.8.1",