Преглед на файлове

using InWechagMsg member function.

master
Patrick Peng Sun преди 8 години
родител
ревизия
a2af88883d
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. +2
    -2
      server.go

+ 2
- 2
server.go Целия файл

@@ -58,7 +58,6 @@ func answerInitialAuth(w http.ResponseWriter, r *http.Request) {
//answerWechatPost distribute PostRequest according to xml body info
func answerWechatPost(w http.ResponseWriter, r *http.Request) {
in, valid := readWechatInput(r)
in.instantResponse = make(chan string)
reply := "" //nothing
w.Header().Set("Content-Type", "text/xml; charset=utf-8")

@@ -71,7 +70,7 @@ func answerWechatPost(w http.ResponseWriter, r *http.Request) {

//read instant response
reply = <-in.instantResponse
close(in.instantResponse)
in.destroy()
//uncomment the followin two lines to enable echo test
// state, _ := echoCommand(in.header.FromUserName, in)
// reply = state.response
@@ -93,6 +92,7 @@ func readWechatInput(r *http.Request) (result InWechatMsg, valid bool) {
}
valid = true
fmt.Printf("decrypt as: %s\n", d)
result.init()
result.header = ReadCommonHeader(d)
switch result.header.MsgType {
case "text":

Loading…
Отказ
Запис