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:
Alan
2023-07-20 16:31:41 +08:00
committed by GitHub
parent 7ee40bd485
commit 6de9995354
16 changed files with 495 additions and 505 deletions
+6 -3
View File
@@ -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