|
@@ -155,6 +155,13 @@ func (s *Short) Article(stype, id string) error {
|
|
|
s.T["isMember"] = isMember
|
|
|
s.T["isEntniche"] = isEntniche
|
|
|
s.T["isEntnicheNew"] = isEntnicheNew
|
|
|
+ node := CNode(userId)
|
|
|
+ var nodeStr string
|
|
|
+ if node {
|
|
|
+ nodeStr = "true"
|
|
|
+ } else {
|
|
|
+ nodeStr = "false"
|
|
|
+ }
|
|
|
if bm {
|
|
|
//判断有没有取关,取关的话,跳转到关于剑鱼标讯页面
|
|
|
if ssOpenid != nil && ssOpenid != "" {
|
|
@@ -199,7 +206,7 @@ func (s *Short) Article(stype, id string) error {
|
|
|
s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url())
|
|
|
|
|
|
obj := wxvisitD(sid, userId, myopenid, isVip || isMember || isEntniche)
|
|
|
- s.T["canRead"] = SeeDetailLimit(obj, userId, sid)
|
|
|
+ s.T["canRead"] = SeeDetailLimit(obj, userId, sid, node)
|
|
|
if len(obj) > 0 {
|
|
|
FieldProcessing(obj, ssOpenid, industry, id, from_userid, userId, stype, isVip || isMember || isEntniche, true)
|
|
|
|
|
@@ -266,12 +273,14 @@ func (s *Short) Article(stype, id string) error {
|
|
|
sid := sids[0]
|
|
|
indust := s.GetString("industry")
|
|
|
_, _, _, objc := pcVRT(sid, indust, isVip || isMember || isEntniche)
|
|
|
- s.T["canRead"] = SeeDetailLimit(objc, userId, sid)
|
|
|
+
|
|
|
+ s.T["canRead"] = SeeDetailLimit(objc, userId, sid, node)
|
|
|
fmt.Println(s.T["canRead"])
|
|
|
if userId != "" && stype == "indexcontent" { //已登录用户直接跳转至正常三级页
|
|
|
return s.Redirect(fmt.Sprintf("/article/content/%s.html", util.CommonEncodeArticle("content", sid)))
|
|
|
}
|
|
|
- catchKey := fmt.Sprintf("jypcdetail_%s_%s_%v_%v_%v", stype, sid, isVip, isEntniche, isMember)
|
|
|
+
|
|
|
+ catchKey := fmt.Sprintf("jypcdetail_%s_%s_%s_%v_%v_%v_%s", userId, stype, sid, isVip, isEntniche, isMember, nodeStr)
|
|
|
//缓存读取
|
|
|
if res := redis.Get("other", catchKey); res == nil || res == "" {
|
|
|
industry := s.GetString("industry")
|
|
@@ -412,13 +421,13 @@ func CNode(userId string) bool {
|
|
|
}
|
|
|
|
|
|
//查看公告详情次数限制
|
|
|
-func SeeDetailLimit(obj map[string]interface{}, userId, sid string) bool {
|
|
|
+func SeeDetailLimit(obj map[string]interface{}, userId, sid string, node bool) bool {
|
|
|
watchKey := fmt.Sprintf("article_count_%d_%s_%d_%s", time.Now().Year(), time.Now().Month(), time.Now().Day(), userId)
|
|
|
if strings.Contains(obj["subtype"].(string), "拟建") || strings.Contains(obj["subtype"].(string), "采购意向") {
|
|
|
return false
|
|
|
} else {
|
|
|
//检验是否留资
|
|
|
- if CNode(userId) {
|
|
|
+ if node {
|
|
|
return true
|
|
|
}
|
|
|
if seeRes := redis.Get("other", watchKey); seeRes != nil && seeRes != "" {
|