Pārlūkot izejas kodu

Merge branch 'dev/v4.8.45_ws' of qmx/jy into feature/v4.8.45

wangshan 2 gadi atpakaļ
vecāks
revīzija
d261c3534a
1 mainītis faili ar 8 papildinājumiem un 9 dzēšanām
  1. 8 9
      src/jfw/front/shorturl.go

+ 8 - 9
src/jfw/front/shorturl.go

@@ -86,12 +86,12 @@ func (s *Short) Article(stype, id string) error {
 	userId, _ := s.GetSession("userId").(string)
 	//PC端未登录用户程序走此逻辑  WX端走原来逻辑
 	if !mobileReg.MatchString(s.Header("User-Agent")) && (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")
-		}
+		//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)
 }
@@ -296,7 +296,6 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 		isEntniche    bool = userPower.EntnicheStatus > 0                                                 //商机管理
 		privatedata   bool = userPower.PrivateGD                                                          //广东移动DICT 用户
 		isEntService  bool = userPower.Data.Ent.PowerSource > 0 && userPower.Data.Entniche.IsEntPower > 0 //商机管理服务
-		isPay              = isVip || isMember || isEntniche
 		newCanRead         = false
 	)
 	if res != nil && len(*res) > 0 {
@@ -489,11 +488,11 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
 				newCanRead = true
 			}
 		}
-		var detailKey = util.If(isPay || newCanRead, "pay", "free")
+		var detailKey = util.If((isVip && isOldVip) || isMember || isEntniche || newCanRead, "pay", "free")
 		catchKey := fmt.Sprintf("jypcdetail_%s_%s_%s", detailKey, stype, sid)
 		log.Println(catchKey, "-缓存-", userId)
 		if res := redis.Get(redisLimitation, catchKey); res == nil || res == "" {
-			redisTimeOut := util.If(isPay || newCanRead, detailRedisByPayTimeOut, detailRedisByFreeTimeOut).(int)
+			redisTimeOut := util.If((isVip && isOldVip) || isMember || isEntniche || newCanRead, detailRedisByPayTimeOut, detailRedisByFreeTimeOut).(int)
 			industry := s.GetString("industry")
 			var shareid = s.GetString("id")
 			if len(shareid) == 0 {