mirror of
https://github.com/certimate-go/certimate.git
synced 2026-06-22 21:05:48 +08:00
Merge pull request #1039 from googlerobot:bugfix
This commit is contained in:
commit
d788887d45
@ -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
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user