mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
getui
This commit is contained in:
parent
7842545627
commit
f11f8b3e0e
@ -84,7 +84,7 @@ func (g *Getui) Push(userIDList []string, alert, detailContent, platform, operat
|
||||
return "", utils.Wrap(err, "Auth failed")
|
||||
}
|
||||
log.NewInfo(operationID, "getui", utils.GetSelfFuncName(), token, expireTime, err)
|
||||
err = db.DB.SetGetuiToken(token, expireTime-time.Now().Unix()-20)
|
||||
err = db.DB.SetGetuiToken(token, 60*60*23)
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "Auth failed")
|
||||
}
|
||||
@ -114,7 +114,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)
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName(), config.Config.Push.Getui.AppKey, timeStamp, config.Config.Push.Getui.MasterSecret)
|
||||
h := sha256.New()
|
||||
h.Write([]byte(config.Config.Push.Getui.AppKey + strconv.Itoa(int(timeStamp)) + config.Config.Push.Getui.MasterSecret))
|
||||
sum := h.Sum(nil)
|
||||
|
Loading…
x
Reference in New Issue
Block a user