- StoreBoss

This commit is contained in:
gazebo
2019-03-29 17:41:28 +08:00
parent 3dd488a165
commit 51327f90a2
2 changed files with 42 additions and 2 deletions

View File

@@ -82,6 +82,10 @@ func RegisterUser(user *model.User, mobileVerifyCode string, inAuthInfo *auth2.A
if !mobileAuth.IsUserEmpty() {
return nil, model.ErrCodeUserAlreadyExist, auth2.ErrUserMobileAlreadyExist
}
user.Type = model.UserTypeConsumer
if inAuthInfo.AuthBindInfo.Type == dingding.AuthTypeStaff {
user.Type |= model.UserTypeOperator
}
if err = CreateUser(user); err == nil {
if outAuthInfo, err = auth2.BindUser(mobileAuth, user); err == nil && inAuthInfo != nil {
err = auth2.AddAuthBind(outAuthInfo, inAuthInfo)