Эх сурвалжийг харах

feat:邮件三级页发开登录

wangchuanjin 2 жил өмнө
parent
commit
1381a90a7a

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

@@ -59,11 +59,13 @@ var seoAgentReg = regexp.MustCompile("Baiduspider|360Spider|bingbot|Googlebot")
 
 func (s *Short) Article(stype, id string) error {
 	userId, _ := s.GetSession("userId").(string)
-	if (stype == "content" || stype == "indexcontent") && userId == "" && seoAgentReg.MatchString(s.UserAgent()) {
-		sids := encrypt.CommonDecodeArticle(stype, id)
-		return s.NologinCommon("", stype, id, sids[0])
-	} else if userId == "" {
-		return s.Redirect("/notin/page")
+	if (stype == "content" || stype == "indexcontent") && userId == "" {
+		if seoAgentReg.MatchString(s.UserAgent()) {
+			sids := encrypt.CommonDecodeArticle(stype, id)
+			return s.NologinCommon("", stype, id, sids[0])
+		} else {
+			return s.Redirect("/notin/page")
+		}
 	}
 	return s.LoginCommon(userId, stype, id)
 }