- set correct authIDType when calling auth2.Login

This commit is contained in:
gazebo
2019-03-04 17:50:16 +08:00
parent 3e79e8a99b
commit 083f9ccbcf
3 changed files with 11 additions and 4 deletions

View File

@@ -60,6 +60,11 @@ func (c *Auth2Controller) SendVerifyCode() {
// @router /Login [post]
func (c *Auth2Controller) Login() {
c.callLogin(func(params *tAuth2LoginParams) (retVal interface{}, errCode string, err error) {
if params.AuthType == auth2.AuthTypeMobile {
params.AuthIDType = auth2.UserIDMobile
} else if params.AuthType == auth2.AuthTypeEmail {
params.AuthIDType = auth2.UserIDEmail
}
retVal, err = auth2.Login(params.AuthType, params.AuthID, params.AuthIDType, params.AuthSecret)
return retVal, "", err
})