代码优化

This commit is contained in:
2026-10-09 12:36:39 +08:00
parent 97f679d130
commit 4f2a3379da
9 changed files with 28 additions and 26 deletions
+3 -1
View File
@@ -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,
+10 -10
View File
@@ -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 {
+1 -1
View File
@@ -122,7 +122,7 @@ func (ad AdDetailInfo) GetAdvertiseType() int {
}
// advertiseAppId 广告中心应用ID
const advertiseAppId int32 = 4
const advertiseAppId int32 = 5
type advertiseClickReq struct {
Id int64 `json:"id"` // 广告id
+1 -1
View File
@@ -165,7 +165,7 @@ func QuickSearch(objID string, data []cmtmod.ParentRespList) []cmtmod.ParentResp
ID: q.ID.Hex(),
ObjID: objID,
UserID: 100001,
UserName: "91短剧运营",
UserName: "黄果漫剧运营",
UserPortrait: "cf230705/image/cg/227/fg/1bw/a86065d7ab4cbb11ebbebaefc0ee4444.png",
Content: q.Title,
LinkStr: q.Link,