Browse Source

Merge remote-tracking branch 'origin/master' into debug

Roc 3 days ago
parent
commit
da7439a6cf
1 changed files with 15 additions and 15 deletions
  1. 15 15
      services/report/report_chapter.go

+ 15 - 15
services/report/report_chapter.go

@@ -263,21 +263,6 @@ func GetChapterDetail(user user.UserInfo, reportChapterId int) (reportChapterDet
 	reportChapterItem.EndImg = reportInfo.EndImg
 	reportChapterItem.CanvasColor = reportInfo.CanvasColor
 
-	// 图表授权token
-	{
-		isOpenChartExpired, e := base_config.CheckIsOpenChartExpired()
-		if e != nil {
-			err = errors.New("获取图表是否开启鉴权失败,err:" + e.Error())
-			return
-		}
-
-		if isOpenChartExpired {
-			tokenMap := make(map[string]string)
-			reportChapterItem.Content = HandleReportContent(reportChapterItem.Content, "add", tokenMap)
-			reportChapterItem.ContentSub = HandleReportContent(reportChapterItem.ContentSub, "add", tokenMap)
-		}
-	}
-
 	// 手工上传的才返回
 	if reportInfo.VoiceGenerateType == 1 {
 		reportChapterItem.ReportVideoUrl = reportInfo.VideoUrl
@@ -352,6 +337,21 @@ func GetChapterDetail(user user.UserInfo, reportChapterId int) (reportChapterDet
 		reportChapterItem.ContentSub = html.UnescapeString(reportChapter.ContentSub)
 	}
 
+	// 图表授权token
+	{
+		isOpenChartExpired, e := base_config.CheckIsOpenChartExpired()
+		if e != nil {
+			err = errors.New("获取图表是否开启鉴权失败,err:" + e.Error())
+			return
+		}
+
+		if isOpenChartExpired {
+			tokenMap := make(map[string]string)
+			reportChapterItem.Content = HandleReportContent(reportChapterItem.Content, "add", tokenMap)
+			reportChapterItem.ContentSub = HandleReportContent(reportChapterItem.ContentSub, "add", tokenMap)
+		}
+	}
+
 	go AddUserAccessRecord(user, reportInfo.Id, reportInfo.ClassifyNameFirst, reportChapterId, authOk)
 	reportChapterDetail = new(response.ReportChapterDetail)
 	reportChapterDetail.ReportChapterItem = reportChapterItem