...
|
...
|
@@ -39,11 +39,11 @@ func (this *AuthController) SmsCode() { |
|
|
}()
|
|
|
var request *protocol.SmsCodeRequest
|
|
|
if err := this.JsonUnmarshal(&request); err != nil {
|
|
|
msg = protocol.BadRequestParam(2)
|
|
|
msg = protocol.NewMesage(2)
|
|
|
return
|
|
|
}
|
|
|
if b, m := this.Valid(request); !b {
|
|
|
msg = m
|
|
|
if b, _ := this.Valid(request); !b {
|
|
|
msg = protocol.NewResponseMessage(2, "手机号码有误,请重新输入!")
|
|
|
return
|
|
|
}
|
|
|
msg = protocol.NewReturnResponse(auth.SmsCode(request))
|
...
|
...
|
@@ -147,6 +147,10 @@ func (this *AuthController) AuthCheckSmsCode() { |
|
|
}
|
|
|
header := this.GetRequestHeader(this.Ctx)
|
|
|
rsp, err := auth.AuthCheckSmsCode(header, request)
|
|
|
if err != nil {
|
|
|
msg = protocol.NewReturnResponse(rsp, err)
|
|
|
return
|
|
|
}
|
|
|
err = CacheSms.Put(request.Phone, rsp.CaptchaCertificate, 5*time.Minute)
|
|
|
msg = protocol.NewReturnResponse(rsp, err)
|
|
|
} |
...
|
...
|
|