添加判空

This commit is contained in:
wh_zcy 2022-09-13 18:43:45 +08:00
parent fd58f469b6
commit 1829ff0754

View File

@ -68,12 +68,15 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod
} }
isNewUser = true isNewUser = true
} else { } else {
if cu := this.module.modelSession.getUserSession(user.Uid); cu.SessionId != "" { if cu := this.module.modelSession.getUserSession(user.Uid); cu != nil {
if cu.SessionId != "" {
code = pb.ErrorCode_UserLogined code = pb.ErrorCode_UserLogined
return return
} }
} }
}
//bind user //bind user
err = session.Bind(user.Uid, this.service.GetId()) err = session.Bind(user.Uid, this.service.GetId())
if err != nil { if err != nil {