ziwen 2 years ago
parent
commit
a9700d2857
1 changed files with 12 additions and 0 deletions
  1. 12 0
      controller/voice_broadcast/voice_broadcast.go

+ 12 - 0
controller/voice_broadcast/voice_broadcast.go

@@ -10,6 +10,7 @@ import (
 	"hongze/hongze_yb/models/tables/voice_broadcast"
 	"hongze/hongze_yb/models/tables/voice_section"
 	"hongze/hongze_yb/services"
+	"hongze/hongze_yb/services/company"
 	"hongze/hongze_yb/services/user"
 	"hongze/hongze_yb/utils"
 	"io/ioutil"
@@ -42,6 +43,17 @@ func BroadcastList(c *gin.Context) {
 	}
 
 	userinfo := user.GetInfoByClaims(c)
+	ok, checkInfo, _, err := company.CheckBaseFiccPermission(userinfo.CompanyID, int(userinfo.UserID))
+	if err != nil {
+		response.FailMsg("用户权限验证失败", "CheckBaseAuth-用户权限验证失败" + err.Error(), c)
+		c.Abort()
+		return
+	}
+	if !ok {
+		response.AuthError(checkInfo, "暂无权限", c)
+		c.Abort()
+		return
+	}
 	list, err := services.GetVoiceBroadcastList(req.PageIndex, req.PageSize, req.SectionId, req.BroadcastId, userinfo)
 	if err != nil {