作者 陈志颖

fix:普通用户登录

@@ -459,13 +459,16 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom @@ -459,13 +459,16 @@ func CompaniesLogin(header *protocol.RequestHeader, request *protocolx.CenterCom
459 rsp.Phone = request.Phone 459 rsp.Phone = request.Phone
460 rsp.Credentials, _ = utils.GenerateToken(int64(phoneId), request.Phone, protocol.RefreshTokenExipre*time.Second) 460 rsp.Credentials, _ = utils.GenerateToken(int64(phoneId), request.Phone, protocol.RefreshTokenExipre*time.Second)
461 461
462 - //添加手机对应的凭证 462 + // 添加手机对应的凭证
463 userAuth.NewRedisUserCredential(request.Phone).AddAuth(rsp.Credentials) 463 userAuth.NewRedisUserCredential(request.Phone).AddAuth(rsp.Credentials)
464 464
  465 + // 判断是否高管
465 if isSenior { 466 if isSenior {
466 v = map[string]interface{}{"center": rsp} 467 v = map[string]interface{}{"center": rsp}
467 } else { 468 } else {
468 - v = map[string]interface{}{} 469 + rsp.Partner.(map[string]interface{})["companys"] = rsp.Manager.(map[string]interface{})["companys"]
  470 + rsp.Manager.(map[string]interface{})["companys"] = []struct{}{}
  471 + v = map[string]interface{}{"center": rsp}
469 } 472 }
470 473
471 err = transactionContext.CommitTransaction() 474 err = transactionContext.CommitTransaction()