作者 陈志颖

fix:高管判断

... ... @@ -349,6 +349,7 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom
transactionContext, _ = factory.CreateTransactionContext(nil)
imInfo *domain.ImInfo
loginSvr = domain_service.NewPgLoginService(transactionContext)
isSenior bool
)
phoneId, e := strconv.Atoi(request.Phone)
... ... @@ -395,6 +396,7 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom
err = protocol.NewErrWithMessage(10001)
return
}
isSenior = ok
if ok { // 高管
if loginSvr.ManagerLogin(request.Phone, request.Password) != nil && loginSvr.PartnerLogin(request.Phone, request.Password) != nil {
err = protocol.NewCustomMessage(1, "密码输入有误!")
... ... @@ -460,7 +462,12 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom
//添加手机对应的凭证
userAuth.NewRedisUserCredential(request.Phone).AddAuth(rsp.Credentials)
if isSenior {
v = map[string]interface{}{"center": rsp}
} else {
v = map[string]interface{}{}
}
err = transactionContext.CommitTransaction()
return
}
... ...
... ... @@ -50,7 +50,7 @@ func (svr *PgLoginService) CheckIsSenior(phone string, companyId int64) (ok bool
UsersRepository, _ = repository.NewUsersRepository(svr.transactionContext)
)
svr.Phone = phone
user, err := UsersRepository.FindOne(map[string]interface{}{"phone": phone, "status": 1})
user, err := UsersRepository.FindOne(map[string]interface{}{"phone": phone, "status": 1, "deleteAtIsNull": 1})
if err != nil {
return false, err
} else {
... ...