Explorar o código

wip:2024.11.26 增加新标讯未登录 /article/content 302 到seo/nologin/content

wangkaiyue hai 8 meses
pai
achega
5f2d2dd961
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/jfw/front/shorturl.go

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

@@ -188,6 +188,12 @@ func (s *Short) Article(stype, id string) error {
 		if len(sids) == 0 || (len(sids) > 0 && sids[0] == "") {
 		if len(sids) == 0 || (len(sids) > 0 && sids[0] == "") {
 			return s.Redirect(getErrPageUrl(bm, DecodeErr), 302)
 			return s.Redirect(getErrPageUrl(bm, DecodeErr), 302)
 		}
 		}
+		//2024.11.26 增加新标讯未登录 /article/content 302 到seo/nologin/content
+		if mgoId := sids[0]; stype == "content" && mgoId != "" {
+			if bid := mg.StringTOBsonId(mgoId); bid.Timestamp().Unix() > 1732550400 {
+				return s.Redirect(fmt.Sprintf("/nologin/content/%s.html", id), 302)
+			}
+		}
 		return s.NologinCommon("", stype, id, sids[0], bm)
 		return s.NologinCommon("", stype, id, sids[0], bm)
 	}
 	}
 	return s.LoginCommon(sess, stype, id, bm)
 	return s.LoginCommon(sess, stype, id, bm)