From 406faf06a11f0e434ff5d04f3eda55d8dfc4ee96 Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Mon, 14 Sep 2020 13:47:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1APIget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/weixin.go | 10 +++++----- router/api.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/controller/weixin.go b/controller/weixin.go index dac4fda..b21e2f3 100644 --- a/controller/weixin.go +++ b/controller/weixin.go @@ -9,12 +9,12 @@ import ( "sort" ) -func PostCheckWeixinSign(c *gin.Context){ +func GetCheckWeixinSign(c *gin.Context){ token:=config.WeixinToken - signature:=c.PostForm("signature") - timestamp:=c.PostForm("timestamp") - nonce:=c.PostForm("nonce") - echostr:=c.PostForm("echostr") + signature:=c.Query("signature") + timestamp:=c.Query("timestamp") + nonce:=c.Query("nonce") + echostr:=c.Query("echostr") //将token、timestamp、nonce三个参数进行字典序排序 var tempArray = []string{token, timestamp, nonce} sort.Strings(tempArray) diff --git a/router/api.go b/router/api.go index 8862c87..e015d46 100644 --- a/router/api.go +++ b/router/api.go @@ -53,5 +53,5 @@ func InitApiRouter(engine *gin.Engine){ engine.DELETE("/ipblack",middleware.JwtApiMiddleware,controller.DelIpblack) engine.GET("/ipblacks_all",middleware.JwtApiMiddleware,controller.GetIpblacks) //微信接口 - engine.GET("/micro_program",controller.PostCheckWeixinSign) + engine.GET("/micro_program",controller.GetCheckWeixinSign) } \ No newline at end of file