From 4ae3ad7abdcafab3348ac0b7b5167735b208ee3d Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 8 Apr 2022 17:48:16 +0800 Subject: [PATCH] getui --- internal/push/getui/push.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/push/getui/push.go b/internal/push/getui/push.go index d68830a2c..b568d4219 100644 --- a/internal/push/getui/push.go +++ b/internal/push/getui/push.go @@ -6,6 +6,7 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/utils" "bytes" + "crypto/sha256" "crypto/sha512" "encoding/hex" "encoding/json" @@ -114,7 +115,7 @@ func (g *Getui) Push(userIDList []string, alert, detailContent, platform, operat func (g *Getui) Auth(operationID string, timeStamp int64) (token string, expireTime int64, err error) { log.NewInfo(operationID, utils.GetSelfFuncName(), timeStamp) - h := sha512.New() + h := sha256.New() h.Write([]byte(config.Config.Push.Getui.AppKey + strconv.Itoa(int(timeStamp)) + config.Config.Push.Getui.MasterSecret)) sum := h.Sum(nil) sign := hex.EncodeToString(sum)