rdluck 4 年之前
父节点
当前提交
e20fe202bb
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      controllers/article.go

+ 6 - 3
controllers/article.go

@@ -4,6 +4,7 @@ import (
 	"encoding/json"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/utils"
+	"html"
 	"strconv"
 	"strings"
 	"time"
@@ -70,6 +71,8 @@ func (this *ArticleController) Detail() {
 			return
 		}
 
+		detail.Body = html.UnescapeString(detail.Body)
+		detail.Abstract = html.UnescapeString(detail.Abstract)
 		if companyPermission == "" {
 			hasPermission = 2
 			hasFree = 2
@@ -144,9 +147,9 @@ func (this *ArticleController) Detail() {
 		}
 	}
 Loop:
-	if hasPermission !=1{
-		detail.Body=""
-		detail.BodyText=""
+	if hasPermission != 1 {
+		detail.Body = ""
+		detail.BodyText = ""
 	}
 	resp := new(models.ArticleDetailResp)
 	resp.HasPermission = hasPermission