- mobile sms verify added.

This commit is contained in:
gazebo
2018-09-05 18:03:53 +08:00
parent 76b03bf86f
commit 0faaa6b366
7 changed files with 119 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxcallback/auth"
_ "git.rosy.net.cn/jx-callback/business/jxcallback/auth/localpass" // 加载本地用户密码
"git.rosy.net.cn/jx-callback/business/jxcallback/auth/mobile"
"git.rosy.net.cn/jx-callback/business/jxcallback/auth/weixin"
"git.rosy.net.cn/jx-callback/globals"
"github.com/astaxie/beego"
@@ -102,3 +103,31 @@ func (c *AuthController) GetUserInfo() {
return retVal, "", err
})
}
// @Title 发送验证码
// @Description 发送验证码
// @Param mobile formData string true "手机号"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /SendMobileVerifyCode [post]
func (c *AuthController) SendMobileVerifyCode() {
c.callSendMobileVerifyCode(func(params *tAuthSendMobileVerifyCodeParams) (retVal interface{}, errCode string, err error) {
err = mobile.SendVerifyCode(params.Mobile)
return retVal, "", err
})
}
// @Title 绑定手机
// @Description 绑定手机
// @Param token header string true "认证token"
// @Param mobile formData string true "手机号"
// @Param code formData string true "验证码"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /BindMobile [post]
func (c *AuthController) BindMobile() {
c.callBindMobile(func(params *tAuthBindMobileParams) (retVal interface{}, errCode string, err error) {
err = auth.BindMobile(params.Token, params.Mobile, params.Code)
return retVal, "", err
})
}