|
|
@ -14,13 +14,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
package auth
|
|
|
|
package auth
|
|
|
|
|
|
|
|
|
|
|
|
import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
|
|
|
import (
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func (x *UserTokenReq) Check() error {
|
|
|
|
func (x *UserTokenReq) Check() error {
|
|
|
|
if x.UserID == "" {
|
|
|
|
if x.UserID == "" {
|
|
|
|
return errs.ErrArgs.Wrap("userID is empty")
|
|
|
|
return errs.ErrArgs.Wrap("userID is empty")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if x.PlatformID > 9 || x.PlatformID < 1 {
|
|
|
|
if x.PlatformID > constant.AdminPlatformID || x.PlatformID < constant.IOSPlatformID {
|
|
|
|
return errs.ErrArgs.Wrap("platform is invalidate")
|
|
|
|
return errs.ErrArgs.Wrap("platform is invalidate")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
@ -30,7 +33,7 @@ func (x *ForceLogoutReq) Check() error {
|
|
|
|
if x.UserID == "" {
|
|
|
|
if x.UserID == "" {
|
|
|
|
return errs.ErrArgs.Wrap("userID is empty")
|
|
|
|
return errs.ErrArgs.Wrap("userID is empty")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if x.PlatformID > 9 || x.PlatformID < 1 {
|
|
|
|
if x.PlatformID > constant.AdminPlatformID || x.PlatformID < constant.IOSPlatformID {
|
|
|
|
return errs.ErrArgs.Wrap("platformID is invalidate")
|
|
|
|
return errs.ErrArgs.Wrap("platformID is invalidate")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|