This commit is contained in:
gazebo
2019-03-08 16:03:27 +08:00
parent 8bcf464193
commit 9d5381a8d8
2 changed files with 6 additions and 5 deletions

View File

@@ -123,9 +123,9 @@ func createAuthInfo(user IUser, authBindInfo *AuthBindEx) (authInfo *AuthInfo) {
} }
if user != nil { if user != nil {
authInfo.UpdateByIUser(user) authInfo.UpdateByIUser(user)
globals.SugarLogger.Debugf("CreateAuthInfo id:%s, id2:%s, authInfo:%s", authInfo.GetID(), authInfo.GetID2(), authInfo.GetMobile(), utils.Format4Output(authInfo, true)) globals.SugarLogger.Debugf("createAuthInfo id:%s, id2:%s, mobile:%s, authInfo:%s", authInfo.GetID(), authInfo.GetID2(), authInfo.GetMobile(), utils.Format4Output(authInfo, true))
} else { } else {
globals.SugarLogger.Debugf("CreateAuthInfo authInfo:%s", utils.Format4Output(authInfo, true)) globals.SugarLogger.Debugf("createAuthInfo authInfo:%s", utils.Format4Output(authInfo, true))
} }
SetUserInfo(token, authInfo, DefTokenDuration) SetUserInfo(token, authInfo, DefTokenDuration)
return authInfo return authInfo

View File

@@ -14,9 +14,10 @@ type DefAuther struct {
// 此函数为空 // 此函数为空
func (a *DefAuther) AddAuthBind(authBindEx *auth2.AuthBindEx, userName string) (err error) { func (a *DefAuther) AddAuthBind(authBindEx *auth2.AuthBindEx, userName string) (err error) {
dao.WrapAddIDCULDEntity(&authBindEx.AuthBind, userName) authBind := &authBindEx.AuthBind
authBindEx.Status = model.AuthBindStatusNormal dao.WrapAddIDCULDEntity(authBind, userName)
err = dao.CreateEntity(nil, &authBindEx.AuthBind) authBind.Status = model.AuthBindStatusNormal
err = dao.CreateEntity(nil, authBind)
return err return err
} }