使用Go语言实现微信公众平台

2020-01-28 11:01:05王旭

 tmps := []string{token, timestamp, nonce}
 sort.Strings(tmps)
 tmpStr := tmps[0] + tmps[1] + tmps[2]
 tmp := str2sha1(tmpStr)
 if tmp == signature {
  fmt.Fprintf(w, echostr)
 }
}
func main() {
 http.HandleFunc("/check", checkSignature)
 http.HandleFunc("/", action)
 http.ListenAndServe(":8080", nil)
}