mirror of
https://github.com/xinliangnote/go-gin-api.git
synced 2026-10-21 03:52:45 +00:00
Update MD5 签名验证
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user