Skip to content

Commit

Permalink
Merge pull request #2 from RycCheen/master
Browse files Browse the repository at this point in the history
fix bug about timestamp, desc:invalid timestamp, more: [https://ding-…
  • Loading branch information
CatchZeng committed May 26, 2020
2 parents c10a8a5 + c27c983 commit 4c17e57
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions security/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ var dingTalkURL url.URL = url.URL{
Path: "robot/send",
}

var timestamp = strconv.FormatInt(time.Now().Unix()*1000, 10)

// GetDingTalkURL get DingTalk URL with accessToken & secret
// If no signature is set, the secret is set to ""
// 如果没有加签,secret 设置为 "" 即可
Expand All @@ -35,6 +33,7 @@ func GetDingTalkURL(accessToken string, secret string) (string, error) {
return dtu.String(), nil
}

timestamp := strconv.FormatInt(time.Now().Unix()*1000, 10)
sign, err := sign(timestamp, secret)
if err != nil {
dtu.RawQuery = value.Encode()
Expand Down

0 comments on commit 4c17e57

Please sign in to comment.