修改权限部分实现
This commit is contained in:
parent
08c0752803
commit
99dda61a84
|
|
@ -87,7 +87,7 @@ func RunCID(c *gin.Context) {
|
||||||
//获取权限
|
//获取权限
|
||||||
//user := dao.FindUserByUserID(authID)
|
//user := dao.FindUserByUserID(authID)
|
||||||
user := service.GetUserByIDFromUserCenter(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"})
|
c.JSON(200, gin.H{"error": "no run Permissions", "code": proto.NoRunPermissions, "message": "no run Permissions"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -230,7 +230,7 @@ func CIDCallback(c *gin.Context) {
|
||||||
|
|
||||||
//user := dao.FindUserByUserID(res.Auth_id)
|
//user := dao.FindUserByUserID(res.Auth_id)
|
||||||
user := service.GetUserByIDFromUserCenter(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"
|
resp.Code, resp.Message = proto.NoRunPermissions, "the user has no run Permissions"
|
||||||
c.JSON(http.StatusOK, resp)
|
c.JSON(http.StatusOK, resp)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ func UploadFileV2(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
user := dao.FindUserByUserID(id1)
|
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"})
|
c.JSON(http.StatusOK, gin.H{"error": "no upload Permissions", "code": proto.NoUploadPermissions, "message": "failed"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,7 @@ func UploadFile(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
user := dao.FindUserByUserID(id1)
|
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"})
|
c.JSON(http.StatusOK, gin.H{"error": "no upload Permissions", "code": proto.NoUploadPermissions, "message": "failed"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -351,7 +351,7 @@ func SetRedis(c *gin.Context) {
|
||||||
id, _ := c.Get("id")
|
id, _ := c.Get("id")
|
||||||
id1 := int(id.(float64))
|
id1 := int(id.(float64))
|
||||||
user := dao.FindUserByUserID(id1)
|
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"})
|
c.JSON(http.StatusOK, gin.H{"error": "no redis Permissions", "code": proto.NoRedisPermissions, "message": "failed"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -379,7 +379,7 @@ func GetRedis(c *gin.Context) {
|
||||||
id, _ := c.Get("id")
|
id, _ := c.Get("id")
|
||||||
id1 := int(id.(float64))
|
id1 := int(id.(float64))
|
||||||
user := dao.FindUserByUserID(id1)
|
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"})
|
c.JSON(http.StatusOK, gin.H{"error": "no redis Permissions", "code": proto.NoRedisPermissions, "message": "failed"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue