代码优化
This commit is contained in:
@@ -18,6 +18,8 @@ const (
|
||||
PacketTypeTestFlight PacketType = 3 // TF包
|
||||
)
|
||||
|
||||
const statAppId int32 = 5
|
||||
|
||||
type AppVersionReq struct {
|
||||
AppId int32 `json:"appId" binding:"required"` // AppID
|
||||
SysType string `json:"sysType,omitempty"` // 终端类型
|
||||
@@ -38,7 +40,7 @@ type AppVersionResp struct {
|
||||
|
||||
func VersionThreeServer(curVersion, sysType, buildID, packageName string) (resp AppVersionResp, err error) {
|
||||
req := AppVersionReq{
|
||||
AppId: 4,
|
||||
AppId: statAppId,
|
||||
PktType: PacketTypeEnterprise,
|
||||
SysType: sysType,
|
||||
CurVersion: curVersion,
|
||||
|
||||
@@ -711,16 +711,16 @@ func LoginWithH5(ctx *gin.Context) {
|
||||
common.ServeJSON(ctx, stderr.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
// 仅允许 h5/ios 端登录注册,其余 sysType 一律拒绝
|
||||
if p.SysType != "h5" && p.SysType != "ios" {
|
||||
common.ServeJSON(ctx, stderr.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
// devID 以 web 开头的为攻击流量,直接拒绝(忽略大小写)
|
||||
if strings.HasPrefix(strings.ToLower(p.DevID), "web") {
|
||||
common.ServeJSON(ctx, stderr.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
// // 仅允许 h5/ios 端登录注册,其余 sysType 一律拒绝
|
||||
// if p.SysType != "h5" && p.SysType != "ios" {
|
||||
// common.ServeJSON(ctx, stderr.ErrParamError, nil)
|
||||
// return
|
||||
// }
|
||||
// // devID 以 web 开头的为攻击流量,直接拒绝(忽略大小写)
|
||||
// if strings.HasPrefix(strings.ToLower(p.DevID), "web") {
|
||||
// common.ServeJSON(ctx, stderr.ErrParamError, nil)
|
||||
// return
|
||||
// }
|
||||
ip := common.GetIP(ctx)
|
||||
ua, err := common.GetUA(ctx)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user