Browse Source

Merge branch 'need/cygx_1023' of http://8.136.199.33:3000/hongze/hongze_clpt into debug

zhangchuanxing 1 month ago
parent
commit
61efd99b2a
2 changed files with 21 additions and 1 deletions
  1. 20 1
      controllers/article.go
  2. 1 0
      models/article.go

+ 20 - 1
controllers/article.go

@@ -241,8 +241,27 @@ func (this *ArticleController) Detail() {
 			//		}
 			//	}
 			//}
+
+			//如果是下面这几种类型的不用校验主客观权限
+			var NocheckPerssionZK bool //是否需要校验主观客观权限
+			if detail.SeriesName == "产业跟踪" {
+				NocheckPerssionZK = true
+			}
+			if detail.ChartPermissionName == "医药" && detail.SeriesName == "医药周报" {
+				NocheckPerssionZK = true
+			}
+			if detail.ChartPermissionName == "消费" && (detail.SeriesName == "消费周报" || detail.SeriesName == "周度思考") {
+				NocheckPerssionZK = true
+			}
+			if detail.ChartPermissionName == "科技" && detail.SeriesName == "科技前言(周报)" {
+				NocheckPerssionZK = true
+			}
+			if detail.ChartPermissionName == "智造" && (detail.SeriesName == "本周荟" || detail.SeriesName == "智造精粹") {
+				NocheckPerssionZK = true
+			}
+
 			//大行业通过权限校验,再校验主客观权限。只有医药、消费、科技、智造,才会校验主客观权限,热点问答这个匹配类型下的所有报告,也不做主客观校验
-			if hasPersion && utils.InArrayByStr([]string{utils.YI_YAO_NAME, utils.XIAO_FEI_NAME, utils.KE_JI_NAME, utils.ZHI_ZAO_NAME}, articlePermissionName) && matchTypeName != "热点问答" {
+			if !NocheckPerssionZK && hasPersion && utils.InArrayByStr([]string{utils.YI_YAO_NAME, utils.XIAO_FEI_NAME, utils.KE_JI_NAME, utils.ZHI_ZAO_NAME}, articlePermissionName) && matchTypeName != "热点问答" {
 				hasPersion = services.CheckArticlePermissionType(articleId, user)
 			}
 			if !hasPersion {

+ 1 - 0
models/article.go

@@ -82,6 +82,7 @@ type ArticleDetail struct {
 	ShareImg                 string          `description:"分享图片"`
 	ChartPermissionName      string          `description:"行业名称"`
 	Stock                    string          `description:"个股标签"`
+	SeriesName               string          `description:"策略平台系列名称"`
 }
 
 type CygxArticleIdReq struct {