|
@@ -792,13 +792,18 @@ func (wx *Weixin) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
|
log.Println("Weixin parse message failed:", err)
|
|
|
http.Error(w, "", http.StatusBadRequest)
|
|
|
} else {
|
|
|
- if msg.Event == EventTemplateSent || msg.Event == EventView {
|
|
|
+ //update by wcj on 2021-07-29
|
|
|
+ //update before
|
|
|
+ /*if msg.Event == EventTemplateSent || msg.Event == EventView {
|
|
|
http.Error(w, "", http.StatusNotFound)
|
|
|
} else {
|
|
|
wx.routeRequest(w, &msg)
|
|
|
- }
|
|
|
+ }*/
|
|
|
+ //update after
|
|
|
+ wx.routeRequest(w, &msg)
|
|
|
}
|
|
|
}
|
|
|
+ w.Write([]byte("success")) //add by wcj on 2021-07-30
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -819,7 +824,7 @@ func (wx *Weixin) routeRequest(w http.ResponseWriter, r *Request) {
|
|
|
route.handler(writer, r)
|
|
|
return
|
|
|
}
|
|
|
- http.Error(w, "", http.StatusNotFound)
|
|
|
+ //http.Error(w, "", http.StatusNotFound)
|
|
|
return
|
|
|
}
|
|
|
|