|
@@ -59,11 +59,13 @@ var seoAgentReg = regexp.MustCompile("Baiduspider|360Spider|bingbot|Googlebot")
|
|
|
|
|
|
func (s *Short) Article(stype, id string) error {
|
|
func (s *Short) Article(stype, id string) error {
|
|
userId, _ := s.GetSession("userId").(string)
|
|
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)
|
|
return s.LoginCommon(userId, stype, id)
|
|
}
|
|
}
|