Browse Source

图表详情地址强制跳转到对应ID

xingzai 2 years ago
parent
commit
3a854bd550
3 changed files with 6 additions and 2 deletions
  1. 1 1
      controllers/chart.go
  2. 1 1
      services/chart.go
  3. 4 0
      utils/constants.go

+ 1 - 1
controllers/chart.go

@@ -205,7 +205,7 @@ func (this *ChartController) Detail() {
 			return
 		}
 		detail.IsCollection = GetIsCollectionChart
-		detail.HttpUrl += "?token=" + chartUserTokenByMobile
+		detail.HttpUrl = utils.CHART_INFO_HTTP_URL + strconv.Itoa(chartId) + "?token=" + chartUserTokenByMobile
 		//if !detail.IsCollection {
 		//	err = models.RemoveChartCollect(user.UserId, chartId)
 		//}

+ 1 - 1
services/chart.go

@@ -301,7 +301,7 @@ func GetChartCollectionByApi(mobile string, take, skip int) (items []*models.Hom
 		item.PtagName = v.ChartInfo.Ptag.Name
 		item.CtagName = v.ChartInfo.Ctag.Name
 		item.BodyHtml = v.ChartInfo.Cover
-		item.HttpUrl = "https://vmp.hzinsights.com/v2/charts/" + strconv.Itoa(v.ChartId)
+		item.HttpUrl = utils.CHART_INFO_HTTP_URL + strconv.Itoa(v.ChartId)
 		item.IsNeedJump = true
 		items = append(items, item)
 	}

+ 4 - 0
utils/constants.go

@@ -76,3 +76,7 @@ const (
 	CHART_PERMISSION_NAME_MF_YANXUAN = "买方研选"
 	CHART_PERMISSION_ID_YANXUAN      = 31
 )
+
+const (
+	CHART_INFO_HTTP_URL = "https://vmp.hzinsights.com/v2/charts/"
+)