dcsunny 4 年之前
父節點
當前提交
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)