Browse Source

竞品数据href改为剑鱼连接

maxiaoshan 4 years ago
parent
commit
2984ff8ec1
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/saveServer/savedata.go

+ 6 - 0
src/saveServer/savedata.go

@@ -536,6 +536,12 @@ func saveData(href, uuid string, result map[string]interface{}) {
 	_id := tools.NewObjectId()
 	bidcheckrepeat.BidAdd(href, uuid, tools.BsonTOStringId(_id)) //数据id存redis
 	result["_id"] = _id
+	competehref := qutil.ObjToString(result["competehref"])
+	tmphref := qutil.ObjToString(result["href"])
+	strid := tools.BsonTOStringId(_id)
+	if competehref != "" && tmphref == "#" {
+		result["href"] = `https://www.jianyu360.com/article/content/` + qutil.CommonEncodeArticle("content", strid) + `.html`
+	}
 	savelock.Lock()
 	SaveCache = append(SaveCache, result)
 	if len(SaveCache) > 200 {