| @@ -0,0 +1,17 @@ | |||
| package main | |||
| import ( | |||
| "encoding/base64" | |||
| "fmt" | |||
| "net/http" | |||
| ) | |||
| func crmpixel(w http.ResponseWriter, r *http.Request) { | |||
| b64pixel := "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QcIBzEJ3JY/6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAADUlEQVQI12NgYGBgAAAABQABXvMqOgAAAABJRU5ErkJggg==" | |||
| pixel, err := base64.StdEncoding.DecodeString(b64pixel) | |||
| if err == nil { | |||
| w.Write(pixel) | |||
| } else { | |||
| fmt.Fprint(w, "decodig wrong") | |||
| } | |||
| } | |||
| @@ -63,6 +63,7 @@ func setupHTTPHandler() { | |||
| http.HandleFunc("/profile_newly_register", initialRegistrationHandler) | |||
| http.HandleFunc("/iapi/getAccessToken", supplyAccessToken) | |||
| http.HandleFunc("/iapi/createWechatQr", iapiCreateWechatQrCode) | |||
| http.HandleFunc("/crmpixel", crmpixel) //tracking pixel. | |||
| http.ListenAndServe(":65500", nil) | |||
| } | |||