Browse Source

添加策略平台链接跳转token

xingzai 2 years ago
parent
commit
3d2599e802
1 changed files with 14 additions and 12 deletions
  1. 14 12
      controllers/article.go

+ 14 - 12
controllers/article.go

@@ -338,18 +338,20 @@ Loop:
 	}
 
 	// 处理研选下面的路演精华 的报告链接是否跳转
-	//if hasPermission == 1 && detail.ArticleId > utils.SummaryArticleId && detail.ArticleTypeId > 0 {
-	//	articleTYpeDetail, err := models.GetArticleTypeInfo(detail.ArticleTypeId)
-	//	if err != nil && err.Error() != utils.ErrNoRow() {
-	//		br.Msg = "获取信息失败"
-	//		br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
-	//		return
-	//	}
-	//	if articleTYpeDetail != nil {
-	//		detail.IsShowLinkButton = articleTYpeDetail.IsShowLinkButton
-	//	}
-	//	detail.PublishDate = utils.TimeRemoveHms2(detail.PublishDate)
-	//}
+	if hasPermission == 1 && detail.ArticleId > utils.SummaryArticleId && detail.ArticleTypeId > 0 {
+		//articleTYpeDetail, err := models.GetArticleTypeInfo(detail.ArticleTypeId)
+		//if err != nil && err.Error() != utils.ErrNoRow() {
+		//	br.Msg = "获取信息失败"
+		//	br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
+		//	return
+		//}
+		//if articleTYpeDetail != nil {
+		//	detail.IsShowLinkButton = articleTYpeDetail.IsShowLinkButton
+		//}
+		detail.PublishDate = utils.TimeRemoveHms2(detail.PublishDate)
+		chartUserTokenByMobile, _ := services.GetUserTokenByMobile(user.Mobile)
+		detail.ReportLink += "?token=" + chartUserTokenByMobile
+	}
 	resp := new(models.ArticleDetailResp)
 	resp.HasPermission = hasPermission
 	resp.HaveResearch = haveResearch