dcsunny 4 жил өмнө
parent
commit
3c103f6b64
1 өөрчлөгдсөн 3 нэмэгдсэн , 0 устгасан
  1. 3 0
      http/handle.go

+ 3 - 0
http/handle.go

@@ -3,6 +3,7 @@ package http
 import (
 	"bytes"
 	json2 "encoding/json"
+	"fmt"
 	"io/ioutil"
 	"net/http"
 	"strings"
@@ -101,6 +102,7 @@ func ErrHandle(w http.ResponseWriter, r *http.Request, err error) {
 	if code == 1000 {
 		return
 	}
+	fmt.Println(fmt.Sprintf("code:%d", code))
 	w.Header().Set(ContentTypeHeader, "application/json; charset=utf-8")
 	if code == 0 {
 		w.WriteHeader(200)
@@ -124,6 +126,7 @@ func ErrHandle(w http.ResponseWriter, r *http.Request, err error) {
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
+	fmt.Println(string(data))
 	w.Write(data)
 
 	//se := errors.FromError(err)