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