|
@@ -84,37 +84,6 @@ func (this *ArticleController) Detail() {
|
|
|
goto Loop
|
|
|
} else {
|
|
|
hasFree = 1
|
|
|
- // 原有的权限校验 更改于 2021-05-18
|
|
|
- //articlePermission, err := models.GetArticlePermission(detail.SubCategoryName)
|
|
|
- //fmt.Println(articlePermission)
|
|
|
- //fmt.Println(detail.SubCategoryName)
|
|
|
- //if err != nil {
|
|
|
- // br.Msg = "获取信息失败"
|
|
|
- // br.ErrMsg = "获取报告权限失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
|
- // return
|
|
|
- //}
|
|
|
- //if articlePermission == nil {
|
|
|
- // br.Msg = "获取信息失败"
|
|
|
- // br.ErrMsg = "报告权限不存在,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
|
- // return
|
|
|
- //}
|
|
|
- //for _, p := range articlePermission {
|
|
|
- // if strings.Contains(companyPermission, p.PermissionName) {
|
|
|
- // hasPermission = 1
|
|
|
- // historyRecord := new(models.CygxArticleHistoryRecord)
|
|
|
- // historyRecord.UserId = uid
|
|
|
- // historyRecord.ArticleId = articleId
|
|
|
- // historyRecord.CreateTime = time.Now()
|
|
|
- // historyRecord.Mobile = user.Mobile
|
|
|
- // historyRecord.Email = user.Email
|
|
|
- // historyRecord.CompanyId = user.CompanyId
|
|
|
- // historyRecord.CompanyName = user.CompanyName
|
|
|
- // go models.AddCygxArticleHistoryRecord(historyRecord)
|
|
|
- // break
|
|
|
- // } else { //无该行业权限
|
|
|
- // hasPermission = 3
|
|
|
- // }
|
|
|
- //}
|
|
|
var articlePermissionPermissionName string
|
|
|
if detail.CategoryId > 0 {
|
|
|
articlePermission, err := models.GetArticlePermission(detail.CategoryId)
|
|
@@ -249,8 +218,27 @@ Loop:
|
|
|
if hasPermission != 1 {
|
|
|
detail.Body = ""
|
|
|
detail.BodyText = ""
|
|
|
+ } else {
|
|
|
+ articleFollowdetail, err := models.GetArticleFollowDetail(articleId, uid)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取关注信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ detail.FollowNum = articleFollowdetail.DNum
|
|
|
+ detail.CollectionNum = articleFollowdetail.AcNum
|
|
|
+ if articleFollowdetail.MdNum > 0 {
|
|
|
+ detail.IsFollow = true
|
|
|
+ }
|
|
|
+ if detail.IsSummary == 1 {
|
|
|
+ detail.IsBelongSummary = true
|
|
|
+ }
|
|
|
+ if detail.IsReport == 1 {
|
|
|
+ detail.IsBelongReport = true
|
|
|
+ }
|
|
|
}
|
|
|
- fmt.Println(hasPermission)
|
|
|
+
|
|
|
+ fmt.Println(uid)
|
|
|
resp := new(models.ArticleDetailResp)
|
|
|
resp.HasPermission = hasPermission
|
|
|
resp.HasFree = hasFree
|