mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-02 15:56:46 +08:00
fix bug
This commit is contained in:
parent
7dd6869cd1
commit
b176701e51
@ -305,32 +305,6 @@ func (s *organizationServer) CreateOrganizationUser(ctx context.Context, req *rp
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *organizationServer) UpdateOrganizationUser(ctx context.Context, req *rpc.UpdateOrganizationUserReq) (*rpc.UpdateOrganizationUserResp, error) {
|
func (s *organizationServer) UpdateOrganizationUser(ctx context.Context, req *rpc.UpdateOrganizationUserReq) (*rpc.UpdateOrganizationUserResp, error) {
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
authReq := &pbAuth.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}}
|
|
||||||
utils.CopyStructFields(authReq.UserInfo, req.OrganizationUser)
|
|
||||||
authReq.OperationID = req.OperationID
|
|
||||||
etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID)
|
|
||||||
if etcdConn == nil {
|
|
||||||
errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil"
|
|
||||||
log.NewError(req.OperationID, errMsg)
|
|
||||||
return &rpc.UpdateOrganizationUserResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil
|
|
||||||
}
|
|
||||||
client := pbAuth.NewAuthClient(etcdConn)
|
|
||||||
|
|
||||||
reply, err := client.UserRegister(context.Background(), authReq)
|
|
||||||
if err != nil {
|
|
||||||
errMsg := "UserRegister failed " + err.Error()
|
|
||||||
log.NewError(req.OperationID, errMsg)
|
|
||||||
return &rpc.UpdateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil
|
|
||||||
}
|
|
||||||
if reply.CommonResp.ErrCode != 0 {
|
|
||||||
errMsg := "UserRegister failed " + reply.CommonResp.ErrMsg
|
|
||||||
log.NewError(req.OperationID, errMsg)
|
|
||||||
return &rpc.UpdateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
>>>>>>> shichuang
|
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String())
|
||||||
if !token_verify.IsManagerUserID(req.OpUserID) && req.OpUserID != req.OrganizationUser.UserID {
|
if !token_verify.IsManagerUserID(req.OpUserID) && req.OpUserID != req.OrganizationUser.UserID {
|
||||||
errMsg := req.OperationID + " " + req.OpUserID + " is not app manager"
|
errMsg := req.OperationID + " " + req.OpUserID + " is not app manager"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user