Update MD5 签名验证

This commit is contained in:
新亮
2019-10-08 19:32:40 +08:00
parent 81355d4a3f
commit 9eec003785
2 changed files with 6 additions and 7 deletions
+4 -5
View File
@@ -6,11 +6,10 @@ const (
AppName = "go-gin-api"
// MD5 密钥
AppSignSecret = "4OhYXtDYNYxQsGetqASVOTP37jGt5gGY"
// MD5 签名超时时间 120s
AppSignExpiry = "120"
AppMD5SignSecret = "4OhYXtDYNYxQsGetqASVOTP37jGt5gGY"
// MD5 超时时间
AppMD5SignExpiry = "120"
// 超时时间
AppReadTimeout = 120
@@ -34,7 +33,7 @@ const (
ErrorNotifyOpen = -1
// Jaeger 配置信息
JaegerHostPort = "127.0.0.1:6831"
JaegerHostPort = "127.0.0.1:6831"
// Jaeger 配置开关 1=开通 -1=关闭
JaegerOpen = 1
+2 -2
View File
@@ -55,7 +55,7 @@ func createMD5Sign(params url.Values) string {
}
// 自定义签名算法
sign := util.MD5(config.AppSignSecret + str + config.AppSignSecret)
sign := util.MD5(config.AppMD5SignSecret + str + config.AppMD5SignSecret)
return sign
}
@@ -92,7 +92,7 @@ func verifyMD5Sign(c *gin.Context) (map[string]string, error) {
return res, nil
}
exp, _ := strconv.ParseInt(config.AppSignExpiry, 10, 64)
exp, _ := strconv.ParseInt(config.AppMD5SignExpiry, 10, 64)
// 验证过期时间
timestamp := time.Now().Unix()