feat:优化项目信息
This commit is contained in:
@ -7,7 +7,7 @@ import (
|
||||
|
||||
type Sms struct{}
|
||||
|
||||
func (a *Sms) sCaptcha(c *gin.Context) {
|
||||
func (*Sms) Captcha(c *gin.Context) {
|
||||
form := &struct {
|
||||
Mobile string `json:"mobile" form:"mobile" binding:"required"`
|
||||
}{}
|
||||
@ -16,5 +16,18 @@ func (a *Sms) sCaptcha(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
err := controller.NewSms()().Captcha(form.Mobile)
|
||||
APIResponse(err)
|
||||
APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Sms) CaptchaValidate(c *gin.Context) {
|
||||
form := &struct {
|
||||
Mobile string `json:"mobile" form:"mobile" binding:"required"`
|
||||
Captcha string `json:"captcha" form:"captcha" binding:"required"`
|
||||
}{}
|
||||
if err := Bind(form)(c); err != nil {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := controller.NewSms()().CaptchaValidate(form.Mobile, form.Captcha)
|
||||
APIResponse(err, data)(c)
|
||||
}
|
||||
|
Reference in New Issue
Block a user