作者 yangfu

1.增加日志

@@ -81,7 +81,7 @@ func SmsCode(request *protocol.SmsCodeRequest) (rsp *protocol.SmsCodeResponse, e @@ -81,7 +81,7 @@ func SmsCode(request *protocol.SmsCodeRequest) (rsp *protocol.SmsCodeResponse, e
81 if msg, ok := data["msg"]; ok { 81 if msg, ok := data["msg"]; ok {
82 err = protocol.NewCustomMessage(1, msg.(string)) 82 err = protocol.NewCustomMessage(1, msg.(string))
83 } 83 }
84 - log.Error(err, data) 84 + log.Error(err, data, request.Phone)
85 return 85 return
86 } 86 }
87 return 87 return
@@ -2,6 +2,7 @@ package svr @@ -2,6 +2,7 @@ package svr
2 2
3 import ( 3 import (
4 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant" 4 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
  5 + "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log"
5 "strings" 6 "strings"
6 "time" 7 "time"
7 ) 8 )
@@ -17,7 +18,11 @@ func (serviceGateway *HttplibMmmSmsApiServiceGateway) SendSms(phone string) (map @@ -17,7 +18,11 @@ func (serviceGateway *HttplibMmmSmsApiServiceGateway) SendSms(phone string) (map
17 options["phone"] = strings.TrimSpace(phone) 18 options["phone"] = strings.TrimSpace(phone)
18 request.JSONBody(options) 19 request.JSONBody(options)
19 response := make(map[string]interface{}) 20 response := make(map[string]interface{})
20 - request.ToJSON(&response) 21 + err := request.ToJSON(&response)
  22 + if err != nil {
  23 + log.Error("Service Gateway Fail:", err)
  24 + return nil, err
  25 + }
21 data, err := serviceGateway.responseHandle(response) 26 data, err := serviceGateway.responseHandle(response)
22 return data, err 27 return data, err
23 } 28 }