From 99dda61a84cb60cf9aeb8e34344a4fb974ebbe56 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Sat, 18 Oct 2025 22:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=83=E9=99=90=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/cid.go | 4 ++-- handler/file.go | 2 +- handler/tool.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/handler/cid.go b/handler/cid.go index 9babe17..0647672 100644 --- a/handler/cid.go +++ b/handler/cid.go @@ -87,7 +87,7 @@ func RunCID(c *gin.Context) { //获取权限 //user := dao.FindUserByUserID(authID) user := service.GetUserByIDFromUserCenter(authID) - if user.Run > 0 { + if user.Run <= 0 { c.JSON(200, gin.H{"error": "no run Permissions", "code": proto.NoRunPermissions, "message": "no run Permissions"}) return } @@ -230,7 +230,7 @@ func CIDCallback(c *gin.Context) { //user := dao.FindUserByUserID(res.Auth_id) user := service.GetUserByIDFromUserCenter(res.Auth_id) - if user.Run > 0 { + if user.Run <= 0 { resp.Code, resp.Message = proto.NoRunPermissions, "the user has no run Permissions" c.JSON(http.StatusOK, resp) return diff --git a/handler/file.go b/handler/file.go index 253b6a1..fa7f8c5 100644 --- a/handler/file.go +++ b/handler/file.go @@ -141,7 +141,7 @@ func UploadFileV2(c *gin.Context) { } user := dao.FindUserByUserID(id1) - if user.Upload > 0 { + if user.Upload <= 0 { c.JSON(http.StatusOK, gin.H{"error": "no upload Permissions", "code": proto.NoUploadPermissions, "message": "failed"}) return } diff --git a/handler/tool.go b/handler/tool.go index a752db3..390bc3b 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -258,7 +258,7 @@ func UploadFile(c *gin.Context) { } user := dao.FindUserByUserID(id1) - if user.Upload > 0 { + if user.Upload <= 0 { c.JSON(http.StatusOK, gin.H{"error": "no upload Permissions", "code": proto.NoUploadPermissions, "message": "failed"}) return } @@ -351,7 +351,7 @@ func SetRedis(c *gin.Context) { id, _ := c.Get("id") id1 := int(id.(float64)) user := dao.FindUserByUserID(id1) - if user.Redis > 0 { + if user.Redis <= 0 { c.JSON(http.StatusOK, gin.H{"error": "no redis Permissions", "code": proto.NoRedisPermissions, "message": "failed"}) return } @@ -379,7 +379,7 @@ func GetRedis(c *gin.Context) { id, _ := c.Get("id") id1 := int(id.(float64)) user := dao.FindUserByUserID(id1) - if user.Redis > 0 { + if user.Redis <= 0 { c.JSON(http.StatusOK, gin.H{"error": "no redis Permissions", "code": proto.NoRedisPermissions, "message": "failed"}) return }