微信APIget

pull/30/head
taoshihan1991 4 years ago
parent bac6ac4488
commit 406faf06a1

@ -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)

@ -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)
}
Loading…
Cancel
Save