This commit is contained in:
henry
2021-11-24 09:59:29 +08:00
parent cf91d55ab2
commit f007168919
21 changed files with 360 additions and 93 deletions

View File

@ -20,7 +20,7 @@ type (
Mobile, Captcha string
}
Password struct {
Mobile, Password string
Account, Password string
}
Platform struct {
OpenID string
@ -88,13 +88,13 @@ RETURNS:
// loginForPassword 密码登陆
func loginForPassword(params *LoginParams, local string) (*InstanceLoginParams, error) {
if !utils.ValidateMobile(params.Password.Mobile) {
if !utils.ValidateMobile(params.Password.Account) {
return nil, errors.New("手机号码格式异常")
}
mUserInstance := model3.NewUserInstance()
isExist, err := model2.FirstField(mUserInstance.UserInstance, []string{"id", "uuid", "mobile", "password", "salt", "status"},
model2.NewWhere("mobile", params.Password.Mobile), model2.NewWhere("local", local))
model2.NewWhere("mobile", params.Password.Account), model2.NewWhere("local", local))
if err != nil {
return nil, err