From 286fbc07e985d960209e8443a57e7f95efe60efd Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Sat, 22 Feb 2020 20:46:16 +0800 Subject: conf: overhaul security settings --- internal/tool/tool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/tool') diff --git a/internal/tool/tool.go b/internal/tool/tool.go index 37c51dd1..2120fac3 100644 --- a/internal/tool/tool.go +++ b/internal/tool/tool.go @@ -170,7 +170,7 @@ func CreateTimeLimitCode(data string, minutes int, startInf interface{}) string // create sha1 encode string sh := sha1.New() - _, _ = sh.Write([]byte(data + conf.SecretKey + startStr + endStr + com.ToStr(minutes))) + _, _ = sh.Write([]byte(data + conf.Security.SecretKey + startStr + endStr + com.ToStr(minutes))) encoded := hex.EncodeToString(sh.Sum(nil)) code := fmt.Sprintf("%s%06d%s", startStr, minutes, encoded) -- cgit v1.2.3