mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-08-07 11:40:01 +08:00
Error code standardization
This commit is contained in:
parent
6bce40535e
commit
467d44adc6
14
internal/common/check/access.go
Normal file
14
internal/common/check/access.go
Normal file
@ -0,0 +1,14 @@
|
||||
package check
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"context"
|
||||
)
|
||||
|
||||
func Access(ctx context.Context, ownerUserID string) (err error) {
|
||||
_, err = GetUsersInfo(ctx, ownerUserID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return token_verify.CheckAccessV3(ctx, ownerUserID)
|
||||
}
|
@ -162,7 +162,7 @@ func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFri
|
||||
if err := token_verify.CheckAdmin(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if _, err := GetUsersInfo(ctx, req.OwnerUserID); err != nil {
|
||||
if _, err := check.GetUsersInfo(ctx, req.OwnerUserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user