Browse Source

feat:三级页seo

wangchuanjin 2 years ago
parent
commit
5dd1998a51
2 changed files with 1 additions and 2 deletions
  1. 0 1
      src/jfw/front/shorturl.go
  2. 1 1
      src/jfw/jyutil/sessionkeep.go

+ 0 - 1
src/jfw/front/shorturl.go

@@ -59,7 +59,6 @@ var seoAgentReg = regexp.MustCompile("Baiduspider|360Spider|bingbot|Googlebot")
 
 func (s *Short) Article(stype, id string) error {
 	userId, _ := s.GetSession("userId").(string)
-	log.Println("======", stype, userId, seoAgentReg.MatchString(s.UserAgent()))
 	if stype == "content" && userId == "" && seoAgentReg.MatchString(s.UserAgent()) {
 		sids := encrypt.CommonDecodeArticle(stype, id)
 		return s.NologinCommon("", stype, id, sids[0])

+ 1 - 1
src/jfw/jyutil/sessionkeep.go

@@ -95,7 +95,7 @@ func (sk *SessionKeep) Do() bool {
 			}
 		} else {
 			if strings.HasPrefix(rqu, "/article/") {
-				if strings.HasPrefix(rqu, "/article/mailprivate") || strings.HasPrefix(rqu, "/article/bdprivate") || strings.HasPrefix(rqu, "/article/bdcontent") || reg.MatchString(rhdua) || strings.HasPrefix(rqu, "/article/indexcontent") {
+				if strings.HasPrefix(rqu, "/article/content") || strings.HasPrefix(rqu, "/article/mailprivate") || strings.HasPrefix(rqu, "/article/bdprivate") || strings.HasPrefix(rqu, "/article/bdcontent") || reg.MatchString(rhdua) || strings.HasPrefix(rqu, "/article/indexcontent") {
 					return true
 				} else { //只处理pc
 					sk.SetSession["referer"] = sk.R.RequestURI