From 2b5788e7ae4919e45a64b210b0a8d96046fd52c5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 25 Jul 2024 09:44:02 +0800 Subject: [PATCH] 1 --- bin/gamesapi/config/config.json | 2 +- server/gamesapi/service/sapi_forward.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/gamesapi/config/config.json b/bin/gamesapi/config/config.json index 1384b4c1..409fa2b7 100644 --- a/bin/gamesapi/config/config.json +++ b/bin/gamesapi/config/config.json @@ -1,7 +1,7 @@ { "gamesapi_url": "https://game2006sapi-test.kingsome.cn", "redirect_url": "https://game2006api-test.kingsome.cn", - "redirect_secret_key": "", + "redirect_secret_key": "~kCu8jYS)rJ5Ay_pZS_rT#&jOl)Qo0m)", "max_concurrent_num": 10, "request_over_time": 30 } diff --git a/server/gamesapi/service/sapi_forward.go b/server/gamesapi/service/sapi_forward.go index 1a57e5be..81d60513 100644 --- a/server/gamesapi/service/sapi_forward.go +++ b/server/gamesapi/service/sapi_forward.go @@ -102,7 +102,6 @@ func (this *sApiForward) getOrCreate(c *SApiForwardLockCache, accountId string) } func (this *sApiForward) Sign(params []*[]string, nonce string, timeStamp int64, postData string) string { - sign := "" signData := "" q5.Sort(params, func (a *[]string, b *[]string) bool { return (*a)[0] < (*b)[0] @@ -110,6 +109,6 @@ func (this *sApiForward) Sign(params []*[]string, nonce string, timeStamp int64, for _, v := range params { signData += (*v)[0] + "=" + (*v)[1] + "&" } - signData += q5.Md5Str(nonce + q5.ToString(timeStamp) + postData + mt.Table.Config.GetRedirectSecretKey()) - return sign + signData += nonce + q5.ToString(timeStamp) + postData + mt.Table.Config.GetRedirectSecretKey() + return q5.Md5Str(signData) }