mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-10 12:05:58 +08:00
errcode
This commit is contained in:
@@ -8,11 +8,10 @@ import (
|
||||
"Open_IM/pkg/common/db/relation"
|
||||
"Open_IM/pkg/common/log"
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/common/tracelog"
|
||||
"Open_IM/pkg/getcdv3"
|
||||
pbAdminCMS "Open_IM/pkg/proto/admin_cms"
|
||||
server_api_params "Open_IM/pkg/proto/sdk_ws"
|
||||
common "Open_IM/pkg/proto/sdk_ws"
|
||||
|
||||
grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
||||
|
||||
@@ -45,15 +44,15 @@ func NewAdminCMSServer(port int) *adminCMSServer {
|
||||
admin := &adminCMSServer{
|
||||
rpcPort: port,
|
||||
rpcRegisterName: config.Config.RpcRegisterName.OpenImAdminCMSName,
|
||||
etcdSchema: config.Config.Etcd.EtcdSchema,
|
||||
etcdAddr: config.Config.Etcd.EtcdAddr,
|
||||
etcdSchema: config.Config.Zookeeper.Schema,
|
||||
etcdAddr: config.Config.Zookeeper.ZkAddr,
|
||||
}
|
||||
var mysql relation.Mysql
|
||||
var redis cache.RedisClient
|
||||
mysql.InitConn()
|
||||
redis.InitRedis()
|
||||
admin.userInterface = controller.NewUserController(mysql.GormConn())
|
||||
admin.groupInterface = controller.NewGroupController(mysql.GormConn(), redis.GetClient(), nil)
|
||||
admin.groupInterface = controller.NewGroupInterface(mysql.GormConn(), redis.GetClient(), nil)
|
||||
admin.adminCMSInterface = controller.NewAdminCMSController(mysql.GormConn())
|
||||
admin.chatLogInterface = controller.NewChatLogController(mysql.GormConn())
|
||||
return admin
|
||||
@@ -68,7 +67,6 @@ func (s *adminCMSServer) Run() {
|
||||
listenIP = config.Config.ListenIP
|
||||
}
|
||||
address := listenIP + ":" + strconv.Itoa(s.rpcPort)
|
||||
|
||||
//listener network
|
||||
listener, err := net.Listen("tcp", address)
|
||||
if err != nil {
|
||||
@@ -116,7 +114,7 @@ func (s *adminCMSServer) AdminLogin(ctx context.Context, req *pbAdminCMS.AdminLo
|
||||
resp := &pbAdminCMS.AdminLoginResp{}
|
||||
for i, adminID := range config.Config.Manager.AppManagerUid {
|
||||
if adminID == req.AdminID && config.Config.Manager.Secrets[i] == req.Secret {
|
||||
token, expTime, err := token_verify.CreateToken(adminID, constant.LinuxPlatformID)
|
||||
token, expTime, err := tokenverify.CreateToken(adminID, constant.LinuxPlatformID)
|
||||
if err != nil {
|
||||
log.NewError(tracelog.GetOperationID(ctx), utils.GetSelfFuncName(), "generate token failed", "adminID: ", adminID, err.Error())
|
||||
return nil, err
|
||||
@@ -140,7 +138,7 @@ func (s *adminCMSServer) AdminLogin(ctx context.Context, req *pbAdminCMS.AdminLo
|
||||
}
|
||||
|
||||
func (s *adminCMSServer) GetUserToken(ctx context.Context, req *pbAdminCMS.GetUserTokenReq) (*pbAdminCMS.GetUserTokenResp, error) {
|
||||
token, expTime, err := token_verify.CreateToken(req.UserID, int(req.PlatformID))
|
||||
token, expTime, err := tokenverify.CreateToken(req.UserID, int(req.PlatformID))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -529,8 +527,8 @@ func (s *adminCMSServer) GetUserFriends(ctx context.Context, req *pbAdminCMS.Get
|
||||
resp.FriendNums = int32(count)
|
||||
}
|
||||
for _, v := range friendList {
|
||||
friendInfo := &server_api_params.FriendInfo{}
|
||||
userInfo := &server_api_params.UserInfo{UserID: v.FriendUserID, Nickname: v.Nickname}
|
||||
friendInfo := &common.FriendInfo{}
|
||||
userInfo := &common.UserInfo{UserID: v.FriendUserID, Nickname: v.Nickname}
|
||||
utils.CopyStructFields(friendInfo, v)
|
||||
friendInfo.FriendUser = userInfo
|
||||
resp.FriendInfoList = append(resp.FriendInfoList, friendInfo)
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"Open_IM/pkg/common/db/controller"
|
||||
"Open_IM/pkg/common/log"
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/common/tracelog"
|
||||
discoveryRegistry "Open_IM/pkg/discovery_registry"
|
||||
pbAuth "Open_IM/pkg/proto/auth"
|
||||
@@ -40,8 +40,8 @@ func (s *rpcAuth) UserToken(ctx context.Context, req *pbAuth.UserTokenReq) (*pbA
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (s *rpcAuth) parseToken(ctx context.Context, tokensString, operationID string) (claims *token_verify.Claims, err error) {
|
||||
claims, err = token_verify.GetClaimFromToken(tokensString)
|
||||
func (s *rpcAuth) parseToken(ctx context.Context, tokensString, operationID string) (claims *tokenverify.Claims, err error) {
|
||||
claims, err = tokenverify.GetClaimFromToken(tokensString)
|
||||
if err != nil {
|
||||
return nil, utils.Wrap(err, "")
|
||||
}
|
||||
@@ -77,7 +77,7 @@ func (s *rpcAuth) ParseToken(ctx context.Context, req *pbAuth.ParseTokenReq) (*p
|
||||
|
||||
func (s *rpcAuth) ForceLogout(ctx context.Context, req *pbAuth.ForceLogoutReq) (*pbAuth.ForceLogoutResp, error) {
|
||||
resp := pbAuth.ForceLogoutResp{}
|
||||
if err := token_verify.CheckAdmin(ctx); err != nil {
|
||||
if err := tokenverify.CheckAdmin(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := s.forceKickOff(ctx, req.UserID, req.PlatformID, tracelog.GetOperationID(ctx)); err != nil {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"Open_IM/internal/common/convert"
|
||||
chat "Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/db/table/relation"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/common/tracelog"
|
||||
pbFriend "Open_IM/pkg/proto/friend"
|
||||
"context"
|
||||
@@ -53,7 +53,7 @@ func (s *friendServer) RemoveBlack(ctx context.Context, req *pbFriend.RemoveBlac
|
||||
|
||||
func (s *friendServer) AddBlack(ctx context.Context, req *pbFriend.AddBlackReq) (*pbFriend.AddBlackResp, error) {
|
||||
resp := &pbFriend.AddBlackResp{}
|
||||
if err := token_verify.CheckAccessV3(ctx, req.OwnerUserID); err != nil {
|
||||
if err := tokenverify.CheckAccessV3(ctx, req.OwnerUserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
black := relation.BlackModel{OwnerUserID: req.OwnerUserID, BlockUserID: req.BlackUserID, OperatorUserID: tracelog.GetOpUserID(ctx)}
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/middleware"
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/common/tracelog"
|
||||
pbFriend "Open_IM/pkg/proto/friend"
|
||||
pbUser "Open_IM/pkg/proto/user"
|
||||
@@ -130,7 +130,7 @@ func (s *friendServer) Run() {
|
||||
// ok
|
||||
func (s *friendServer) ApplyToAddFriend(ctx context.Context, req *pbFriend.ApplyToAddFriendReq) (resp *pbFriend.ApplyToAddFriendResp, err error) {
|
||||
resp = &pbFriend.ApplyToAddFriendResp{}
|
||||
if err := token_verify.CheckAccessV3(ctx, req.FromUserID); err != nil {
|
||||
if err := tokenverify.CheckAccessV3(ctx, req.FromUserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := callbackBeforeAddFriendV1(ctx, req); err != nil {
|
||||
@@ -159,7 +159,7 @@ func (s *friendServer) ApplyToAddFriend(ctx context.Context, req *pbFriend.Apply
|
||||
// ok
|
||||
func (s *friendServer) ImportFriends(ctx context.Context, req *pbFriend.ImportFriendReq) (resp *pbFriend.ImportFriendResp, err error) {
|
||||
resp = &pbFriend.ImportFriendResp{}
|
||||
if err := token_verify.CheckAdmin(ctx); err != nil {
|
||||
if err := tokenverify.CheckAdmin(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if _, err := check.GetUsersInfo(ctx, req.OwnerUserID, req.FriendUserIDs); err != nil {
|
||||
|
||||
+12
-12
@@ -13,7 +13,7 @@ import (
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/middleware"
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/common/tracelog"
|
||||
discoveryRegistry "Open_IM/pkg/discovery_registry"
|
||||
pbGroup "Open_IM/pkg/proto/group"
|
||||
@@ -128,7 +128,7 @@ func (s *groupServer) Run() {
|
||||
}
|
||||
|
||||
func (s *groupServer) CheckGroupAdmin(ctx context.Context, groupID string) error {
|
||||
if !token_verify.IsAppManagerUid(ctx) {
|
||||
if !tokenverify.IsAppManagerUid(ctx) {
|
||||
groupMember, err := s.GroupInterface.TakeGroupMember(ctx, groupID, tracelog.GetOpUserID(ctx))
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -142,7 +142,7 @@ func (s *groupServer) CheckGroupAdmin(ctx context.Context, groupID string) error
|
||||
|
||||
func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupReq) (*pbGroup.CreateGroupResp, error) {
|
||||
resp := &pbGroup.CreateGroupResp{GroupInfo: &open_im_sdk.GroupInfo{}}
|
||||
if err := token_verify.CheckAccessV3(ctx, req.OwnerUserID); err != nil {
|
||||
if err := tokenverify.CheckAccessV3(ctx, req.OwnerUserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if req.OwnerUserID == "" {
|
||||
@@ -216,7 +216,7 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
|
||||
|
||||
func (s *groupServer) GetJoinedGroupList(ctx context.Context, req *pbGroup.GetJoinedGroupListReq) (*pbGroup.GetJoinedGroupListResp, error) {
|
||||
resp := &pbGroup.GetJoinedGroupListResp{}
|
||||
if err := token_verify.CheckAccessV3(ctx, req.FromUserID); err != nil {
|
||||
if err := tokenverify.CheckAccessV3(ctx, req.FromUserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
total, members, err := s.GroupInterface.PageGroupMember(ctx, nil, []string{req.FromUserID}, nil, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
@@ -286,7 +286,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
||||
return nil, constant.ErrArgs.Wrap("user not found " + strings.Join(ids, ","))
|
||||
}
|
||||
if group.NeedVerification == constant.AllNeedVerification {
|
||||
if !token_verify.IsAppManagerUid(ctx) {
|
||||
if !tokenverify.IsAppManagerUid(ctx) {
|
||||
opUserID := tracelog.GetOpUserID(ctx)
|
||||
member, ok := memberMap[opUserID]
|
||||
if !ok {
|
||||
@@ -418,7 +418,7 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou
|
||||
return nil, constant.ErrUserIDNotFound.Wrap(userID)
|
||||
}
|
||||
}
|
||||
if !token_verify.IsAppManagerUid(ctx) {
|
||||
if !tokenverify.IsAppManagerUid(ctx) {
|
||||
member := memberMap[opUserID]
|
||||
if member == nil {
|
||||
return nil, constant.ErrNoPermission.Wrap(fmt.Sprintf("opUserID %s no in group", opUserID))
|
||||
@@ -549,7 +549,7 @@ func (s *groupServer) GroupApplicationResponse(ctx context.Context, req *pbGroup
|
||||
if !utils.Contain(req.HandleResult, constant.GroupResponseAgree, constant.GroupResponseRefuse) {
|
||||
return nil, constant.ErrArgs.Wrap("HandleResult unknown")
|
||||
}
|
||||
if !token_verify.IsAppManagerUid(ctx) {
|
||||
if !tokenverify.IsAppManagerUid(ctx) {
|
||||
groupMember, err := s.GroupInterface.TakeGroupMember(ctx, req.GroupID, req.FromUserID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -682,7 +682,7 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq)
|
||||
|
||||
func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInfoReq) (*pbGroup.SetGroupInfoResp, error) {
|
||||
resp := &pbGroup.SetGroupInfoResp{}
|
||||
if !token_verify.IsAppManagerUid(ctx) {
|
||||
if !tokenverify.IsAppManagerUid(ctx) {
|
||||
groupMember, err := s.GroupInterface.TakeGroupMember(ctx, req.GroupInfoForSet.GroupID, tracelog.GetOpUserID(ctx))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -741,7 +741,7 @@ func (s *groupServer) TransferGroupOwner(ctx context.Context, req *pbGroup.Trans
|
||||
return nil, constant.ErrArgs.Wrap("NewOwnerUser not in group " + req.NewOwnerUserID)
|
||||
}
|
||||
oldOwner := memberMap[req.OldOwnerUserID]
|
||||
if token_verify.IsAppManagerUid(ctx) {
|
||||
if tokenverify.IsAppManagerUid(ctx) {
|
||||
if oldOwner == nil {
|
||||
oldOwner, err = s.GroupInterface.TakeGroupOwner(ctx, req.OldOwnerUserID)
|
||||
if err != nil {
|
||||
@@ -893,7 +893,7 @@ func (s *groupServer) MuteGroupMember(ctx context.Context, req *pbGroup.MuteGrou
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !(tracelog.GetOpUserID(ctx) == req.UserID || token_verify.IsAppManagerUid(ctx)) {
|
||||
if !(tracelog.GetOpUserID(ctx) == req.UserID || tokenverify.IsAppManagerUid(ctx)) {
|
||||
opMember, err := s.GroupInterface.TakeGroupMember(ctx, req.GroupID, req.UserID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -916,7 +916,7 @@ func (s *groupServer) CancelMuteGroupMember(ctx context.Context, req *pbGroup.Ca
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !(tracelog.GetOpUserID(ctx) == req.UserID || token_verify.IsAppManagerUid(ctx)) {
|
||||
if !(tracelog.GetOpUserID(ctx) == req.UserID || tokenverify.IsAppManagerUid(ctx)) {
|
||||
opMember, err := s.GroupInterface.TakeGroupMember(ctx, req.GroupID, tracelog.GetOpUserID(ctx))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -985,7 +985,7 @@ func (s *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbGroup.SetGr
|
||||
if req.RoleLevel != nil {
|
||||
return nil, constant.ErrArgs.Wrap("update role level")
|
||||
}
|
||||
} else if !token_verify.IsAppManagerUid(ctx) {
|
||||
} else if !tokenverify.IsAppManagerUid(ctx) {
|
||||
opMember, err := s.GroupInterface.TakeGroupMember(ctx, req.GroupID, tracelog.GetOpUserID(ctx))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
pbChat "Open_IM/pkg/proto/msg"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
func (rpc *rpcChat) ClearMsg(_ context.Context, req *pbChat.ClearMsgReq) (*pbChat.ClearMsgResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc req: ", req.String())
|
||||
if req.OpUserID != req.UserID && !token_verify.IsManagerUserID(req.UserID) {
|
||||
if req.OpUserID != req.UserID && !tokenverify.IsManagerUserID(req.UserID) {
|
||||
errMsg := "No permission" + req.OpUserID + req.UserID
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.ClearMsgResp{ErrCode: constant.ErrNoPermission.ErrCode, ErrMsg: errMsg}, nil
|
||||
@@ -39,7 +39,7 @@ func (rpc *rpcChat) ClearMsg(_ context.Context, req *pbChat.ClearMsgReq) (*pbCha
|
||||
|
||||
func (rpc *rpcChat) SetMsgMinSeq(_ context.Context, req *pbChat.SetMsgMinSeqReq) (*pbChat.SetMsgMinSeqResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc req: ", req.String())
|
||||
if req.OpUserID != req.UserID && !token_verify.IsManagerUserID(req.UserID) {
|
||||
if req.OpUserID != req.UserID && !tokenverify.IsManagerUserID(req.UserID) {
|
||||
errMsg := "No permission" + req.OpUserID + req.UserID
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.SetMsgMinSeqResp{ErrCode: constant.ErrNoPermission.ErrCode, ErrMsg: errMsg}, nil
|
||||
|
||||
@@ -4,17 +4,17 @@ import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/proto/msg"
|
||||
commonPb "Open_IM/pkg/proto/sdk_ws"
|
||||
common "Open_IM/pkg/proto/sdk_ws"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (rpc *rpcChat) DelMsgList(_ context.Context, req *commonPb.DelMsgListReq) (*commonPb.DelMsgListResp, error) {
|
||||
func (rpc *rpcChat) DelMsgList(_ context.Context, req *common.DelMsgListReq) (*common.DelMsgListResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||
resp := &commonPb.DelMsgListResp{}
|
||||
resp := &common.DelMsgListResp{}
|
||||
select {
|
||||
case rpc.delMsgCh <- deleteMsg{
|
||||
UserID: req.UserID,
|
||||
@@ -32,7 +32,7 @@ func (rpc *rpcChat) DelMsgList(_ context.Context, req *commonPb.DelMsgListReq) (
|
||||
}
|
||||
func (rpc *rpcChat) DelSuperGroupMsg(ctx context.Context, req *msg.DelSuperGroupMsgReq) (*msg.DelSuperGroupMsgResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||
if !token_verify.CheckAccess(ctx, req.OpUserID, req.UserID) {
|
||||
if !tokenverify.CheckAccess(ctx, req.OpUserID, req.UserID) {
|
||||
log.NewError(req.OperationID, "CheckAccess false ", req.OpUserID, req.UserID)
|
||||
return &msg.DelSuperGroupMsgResp{ErrCode: constant.ErrNoPermission.ErrCode, ErrMsg: constant.ErrNoPermission.ErrMsg}, nil
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
utils2 "Open_IM/pkg/common/utils"
|
||||
pbGroup "Open_IM/pkg/proto/group"
|
||||
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
//} creator->group
|
||||
|
||||
func setOpUserInfo(opUserID, groupID string, groupMemberInfo *open_im_sdk.GroupMemberFullInfo) error {
|
||||
if token_verify.IsManagerUserID(opUserID) {
|
||||
if tokenverify.IsManagerUserID(opUserID) {
|
||||
u, err := imdb.GetUserByUserID(opUserID)
|
||||
if err != nil {
|
||||
return utils.Wrap(err, "GetUserByUserID failed")
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"Open_IM/pkg/common/db"
|
||||
rocksCache "Open_IM/pkg/common/db/rocks_cache"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/getcdv3"
|
||||
cacheRpc "Open_IM/pkg/proto/cache"
|
||||
pbConversation "Open_IM/pkg/proto/conversation"
|
||||
@@ -182,7 +182,7 @@ func (rpc *rpcChat) messageVerification(ctx context.Context, data *pbChat.SendMs
|
||||
log.NewError(data.OperationID, errMsg)
|
||||
return false, 201, errMsg, nil
|
||||
}
|
||||
if token_verify.IsManagerUserID(data.MsgData.SendID) {
|
||||
if tokenverify.IsManagerUserID(data.MsgData.SendID) {
|
||||
return true, 0, "", userIDList
|
||||
}
|
||||
if data.MsgData.ContentType <= constant.NotificationEnd && data.MsgData.ContentType >= constant.NotificationBegin {
|
||||
@@ -256,7 +256,7 @@ func (rpc *rpcChat) messageVerification(ctx context.Context, data *pbChat.SendMs
|
||||
log.NewError(data.OperationID, errMsg)
|
||||
return false, 201, errMsg, nil
|
||||
}
|
||||
if token_verify.IsManagerUserID(data.MsgData.SendID) {
|
||||
if tokenverify.IsManagerUserID(data.MsgData.SendID) {
|
||||
return true, 0, "", userIDList
|
||||
}
|
||||
if data.MsgData.ContentType <= constant.NotificationEnd && data.MsgData.ContentType >= constant.NotificationBegin {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
relationTb "Open_IM/pkg/common/db/table/relation"
|
||||
"Open_IM/pkg/common/log"
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/common/tracelog"
|
||||
server_api_params "Open_IM/pkg/proto/sdk_ws"
|
||||
pbUser "Open_IM/pkg/proto/user"
|
||||
@@ -179,7 +179,7 @@ func (s *userServer) GetAllPageFriends(ctx context.Context, ownerUserID string)
|
||||
// ok
|
||||
func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserInfoReq) (resp *pbUser.UpdateUserInfoResp, err error) {
|
||||
resp = &pbUser.UpdateUserInfoResp{}
|
||||
err = token_verify.CheckAccessV3(ctx, req.UserInfo.UserID)
|
||||
err = tokenverify.CheckAccessV3(ctx, req.UserInfo.UserID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -240,7 +240,7 @@ func (s *userServer) AccountCheck(ctx context.Context, req *pbUser.AccountCheckR
|
||||
if utils.Duplicate(req.CheckUserIDs) {
|
||||
return nil, constant.ErrArgs.Wrap("userID repeated")
|
||||
}
|
||||
err = token_verify.CheckAdmin(ctx)
|
||||
err = tokenverify.CheckAdmin(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user