mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-12 04:55:59 +08:00
parameter range error (#606)
* message for your changes Signed-off-by: ‘hanzhixiao’ <‘709674996@qq.com’> * debug Signed-off-by: ‘hanzhixiao’ <‘709674996@qq.com’> * Delete start.bat * Delete build.cmd * fix: parameter check Signed-off-by: hanzhixiao <709674996@qq.com> * fix: parameter check Signed-off-by: hanzhixiao <709674996@qq.com> --------- Signed-off-by: ‘hanzhixiao’ <‘709674996@qq.com’> Signed-off-by: hanzhixiao <709674996@qq.com> Co-authored-by: ‘hanzhixiao’ <‘709674996@qq.com’>
This commit is contained in:
@@ -14,13 +14,16 @@
|
||||
|
||||
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 {
|
||||
if x.UserID == "" {
|
||||
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 nil
|
||||
@@ -30,7 +33,7 @@ func (x *ForceLogoutReq) Check() error {
|
||||
if x.UserID == "" {
|
||||
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 nil
|
||||
|
||||
Reference in New Issue
Block a user