zhangxinlei1996 4 年之前
父節點
當前提交
d41bf1bdc1
共有 2 個文件被更改,包括 9 次插入14 次删除
  1. 4 12
      src/jfw/front/pcIndex.go
  2. 5 2
      src/jfw/front/shorturl.go

+ 4 - 12
src/jfw/front/pcIndex.go

@@ -26,22 +26,12 @@ type PcIndex struct {
 	newSordfish  xweb.Mapper `xweb:"/"`                        //剑鱼标讯pc首页
 	newSordfishC xweb.Mapper `xweb:"/pcindex.html"`            //剑鱼标讯pc首页-统计
 	searchResult xweb.Mapper `xweb:"/list/(\\w+)/(\\w+).html"` //剑鱼标讯分类 地区结果列表
-	tesa         xweb.Mapper `xweb:"/index/tesa"`
 }
 
 func init() {
 	xweb.AddAction(&PcIndex{})
 }
 
-func (d *PcIndex) Tesa() {
-	typ, _ := d.GetInteger("typ")
-	// d.WriteBytes([]byte("ok,清除路径:" + "pc/index.html"))
-	// m := GetNewBlog()
-	// m := getstypeMap()
-	m := GetLabUrl(typ)
-	d.ServeJson(m)
-}
-
 //剑鱼标讯pc首页
 func (m *PcIndex) NewSordfish() error {
 	ispc, _ := m.GetInteger("ispc")
@@ -164,7 +154,8 @@ func GetNewArticle(typ int) (list []map[string]interface{}) {
 		if lists != nil && len(*lists) > 5 {
 			*lists = (*lists)[0:6]
 			for _, v := range *lists {
-				v["_id"] = util.EncodeArticleId2ByCheck(v["_id"].(string))
+				// v["_id"] = util.EncodeArticleId2ByCheck(v["_id"].(string))
+				v["_id"] = util.CommonEncodeArticle("indexcontent", v["_id"].(string))
 				delete(v, "toptype")
 				delete(v, "s_subscopeclass")
 				tmpdate := v["publishtime"]
@@ -430,7 +421,8 @@ func (f *PcIndex) SearchResult(at, name string) error {
 			}
 			if datas != nil && len(*datas) > 0 {
 				for _, v := range *datas {
-					v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))
+					// v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))
+					v["_id"] = util.CommonEncodeArticle("indexcontent", util.ObjToString(v["_id"]))
 				}
 			}
 			timeout := util.IntAllDef(config.Sysconfig["pcIndexHotCacheTime"], 7200)

+ 5 - 2
src/jfw/front/shorturl.go

@@ -160,7 +160,6 @@ func (s *Short) Article(stype, id string) error {
 					s.T["obj"] = retMap
 					s.Render("/pc/biddetail_bd.html", &s.T)
 				} else {
-					log.Println("===#33")
 					s.Redirect("/notin/page", 302)
 				}
 			}
@@ -367,7 +366,11 @@ func (s *Short) Article(stype, id string) error {
 				}
 
 				content, _ := s.Render4Cache("/pc/biddetail_rec.html", &s.T)
-				redis.Put("other", catchKey, string(content), 60*60*2)
+				timeout := 60 * 20
+				if stype == "indexcontent" {
+					timeout = 60 * 10
+				}
+				redis.Put("other", catchKey, string(content), timeout)
 				return s.SetBody(content)
 			}
 		} else {