作者 陈志颖

fix:高管判断

@@ -349,6 +349,7 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom @@ -349,6 +349,7 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom
349 transactionContext, _ = factory.CreateTransactionContext(nil) 349 transactionContext, _ = factory.CreateTransactionContext(nil)
350 imInfo *domain.ImInfo 350 imInfo *domain.ImInfo
351 loginSvr = domain_service.NewPgLoginService(transactionContext) 351 loginSvr = domain_service.NewPgLoginService(transactionContext)
  352 + isSenior bool
352 ) 353 )
353 354
354 phoneId, e := strconv.Atoi(request.Phone) 355 phoneId, e := strconv.Atoi(request.Phone)
@@ -395,6 +396,7 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom @@ -395,6 +396,7 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom
395 err = protocol.NewErrWithMessage(10001) 396 err = protocol.NewErrWithMessage(10001)
396 return 397 return
397 } 398 }
  399 + isSenior = ok
398 if ok { // 高管 400 if ok { // 高管
399 if loginSvr.ManagerLogin(request.Phone, request.Password) != nil && loginSvr.PartnerLogin(request.Phone, request.Password) != nil { 401 if loginSvr.ManagerLogin(request.Phone, request.Password) != nil && loginSvr.PartnerLogin(request.Phone, request.Password) != nil {
400 err = protocol.NewCustomMessage(1, "密码输入有误!") 402 err = protocol.NewCustomMessage(1, "密码输入有误!")
@@ -460,7 +462,12 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom @@ -460,7 +462,12 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom
460 //添加手机对应的凭证 462 //添加手机对应的凭证
461 userAuth.NewRedisUserCredential(request.Phone).AddAuth(rsp.Credentials) 463 userAuth.NewRedisUserCredential(request.Phone).AddAuth(rsp.Credentials)
462 464
  465 + if isSenior {
463 v = map[string]interface{}{"center": rsp} 466 v = map[string]interface{}{"center": rsp}
  467 + } else {
  468 + v = map[string]interface{}{}
  469 + }
  470 +
464 err = transactionContext.CommitTransaction() 471 err = transactionContext.CommitTransaction()
465 return 472 return
466 } 473 }
@@ -50,7 +50,7 @@ func (svr *PgLoginService) CheckIsSenior(phone string, companyId int64) (ok bool @@ -50,7 +50,7 @@ func (svr *PgLoginService) CheckIsSenior(phone string, companyId int64) (ok bool
50 UsersRepository, _ = repository.NewUsersRepository(svr.transactionContext) 50 UsersRepository, _ = repository.NewUsersRepository(svr.transactionContext)
51 ) 51 )
52 svr.Phone = phone 52 svr.Phone = phone
53 - user, err := UsersRepository.FindOne(map[string]interface{}{"phone": phone, "status": 1}) 53 + user, err := UsersRepository.FindOne(map[string]interface{}{"phone": phone, "status": 1, "deleteAtIsNull": 1})
54 if err != nil { 54 if err != nil {
55 return false, err 55 return false, err
56 } else { 56 } else {