|
@@ -39,11 +39,11 @@ func (this *AuthController) SmsCode() { |
|
@@ -39,11 +39,11 @@ func (this *AuthController) SmsCode() { |
39
|
}()
|
39
|
}()
|
40
|
var request *protocol.SmsCodeRequest
|
40
|
var request *protocol.SmsCodeRequest
|
41
|
if err := this.JsonUnmarshal(&request); err != nil {
|
41
|
if err := this.JsonUnmarshal(&request); err != nil {
|
42
|
- msg = protocol.BadRequestParam(2)
|
42
|
+ msg = protocol.NewMesage(2)
|
43
|
return
|
43
|
return
|
44
|
}
|
44
|
}
|
45
|
- if b, m := this.Valid(request); !b {
|
|
|
46
|
- msg = m
|
45
|
+ if b, _ := this.Valid(request); !b {
|
|
|
46
|
+ msg = protocol.NewResponseMessage(2, "手机号码有误,请重新输入!")
|
47
|
return
|
47
|
return
|
48
|
}
|
48
|
}
|
49
|
msg = protocol.NewReturnResponse(auth.SmsCode(request))
|
49
|
msg = protocol.NewReturnResponse(auth.SmsCode(request))
|
|
@@ -147,6 +147,10 @@ func (this *AuthController) AuthCheckSmsCode() { |
|
@@ -147,6 +147,10 @@ func (this *AuthController) AuthCheckSmsCode() { |
147
|
}
|
147
|
}
|
148
|
header := this.GetRequestHeader(this.Ctx)
|
148
|
header := this.GetRequestHeader(this.Ctx)
|
149
|
rsp, err := auth.AuthCheckSmsCode(header, request)
|
149
|
rsp, err := auth.AuthCheckSmsCode(header, request)
|
|
|
150
|
+ if err != nil {
|
|
|
151
|
+ msg = protocol.NewReturnResponse(rsp, err)
|
|
|
152
|
+ return
|
|
|
153
|
+ }
|
150
|
err = CacheSms.Put(request.Phone, rsp.CaptchaCertificate, 5*time.Minute)
|
154
|
err = CacheSms.Put(request.Phone, rsp.CaptchaCertificate, 5*time.Minute)
|
151
|
msg = protocol.NewReturnResponse(rsp, err)
|
155
|
msg = protocol.NewReturnResponse(rsp, err)
|
152
|
} |
156
|
} |