소스 검색

feat:三级页seo

wangchuanjin 2 년 전
부모
커밋
0abf665d6d
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/jfw/front/shorturl.go

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

@@ -59,7 +59,7 @@ var seoAgentReg = regexp.MustCompile("Baiduspider|360Spider|bingbot|Googlebot")
 
 func (s *Short) Article(stype, id string) error {
 	userId, _ := s.GetSession("userId").(string)
-	if stype == "article" && userId == "" && seoAgentReg.MatchString(s.UserAgent()) {
+	if stype == "content" && userId == "" && seoAgentReg.MatchString(s.UserAgent()) {
 		sids := encrypt.CommonDecodeArticle(stype, id)
 		return s.NologinCommon("", "nologin", encrypt.CommonEncodeArticle("nologin", sids[0]), sids[0])
 	}
@@ -988,7 +988,7 @@ func (s *Short) NologinArticle(stype, id string) error {
 		return nil
 	}
 	if userId != "" { //已登录用户直接跳转至正常三级页
-		return s.LoginCommon(userId, "article", encrypt.CommonEncodeArticle("content", sids[0]))
+		return s.LoginCommon(userId, "content", encrypt.CommonEncodeArticle("content", sids[0]))
 	}
 	return s.NologinCommon(userId, stype, id, sids[0])
 }