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 }