golangci-lint run

This commit is contained in:
孟帅
2023-07-24 09:35:30 +08:00
parent 071b6224c9
commit 996ed818ee
61 changed files with 527 additions and 271 deletions

View File

@@ -34,37 +34,37 @@ func (s *sTCPServer) OnAuthSummary(ctx context.Context, req *servmsg.AuthSummary
if conn.Auth == nil {
res.SetError(gerror.New("登录信息获取失败,请重新登录"))
conn.Send(ctx, res)
_ = conn.Send(ctx, res)
return
}
if err := dao.SysServeLicense.Ctx(ctx).Where("appid = ?", conn.Auth.AppId).Scan(&models); err != nil {
res.SetError(err)
conn.Send(ctx, res)
_ = conn.Send(ctx, res)
return
}
if models == nil {
res.SetError(gerror.New("授权信息不存在"))
conn.Send(ctx, res)
_ = conn.Send(ctx, res)
return
}
if models.Status != consts.StatusEnabled {
res.SetError(gerror.New("授权已禁用,请联系管理员"))
conn.Send(ctx, res)
_ = conn.Send(ctx, res)
return
}
if models.Group != conn.Auth.Group {
res.SetError(gerror.New("你登录的授权分组未得到授权,请联系管理员"))
conn.Send(ctx, res)
_ = conn.Send(ctx, res)
return
}
if models.EndAt.Before(gtime.Now()) {
res.SetError(gerror.New("授权已过期,请联系管理员"))
conn.Send(ctx, res)
_ = conn.Send(ctx, res)
return
}
@@ -76,5 +76,5 @@ func (s *sTCPServer) OnAuthSummary(ctx context.Context, req *servmsg.AuthSummary
// ...
res.Data = data
conn.Send(ctx, res)
_ = conn.Send(ctx, res)
}