浏览代码

fix:公告详情查看次数限制

xuemingyang 3 年之前
父节点
当前提交
a35f838534
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      src/jfw/front/shorturl.go

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

@@ -233,11 +233,6 @@ func (s *Short) Article(stype, id string) error {
 				sidss := strings.Split(resVal, "_")
 				sidss := strings.Split(resVal, "_")
 				canRead := config.Sysconfig["canReadNotice"]
 				canRead := config.Sysconfig["canReadNotice"]
 				if len(sidss) < util.IntAll(canRead) {
 				if len(sidss) < util.IntAll(canRead) {
-					for _, v := range sidss {
-						if sid == v {
-							s.T["canRead"] = true
-						}
-					}
 					s.T["canRead"] = true
 					s.T["canRead"] = true
 					sidss = append(sidss, sid)
 					sidss = append(sidss, sid)
 					arrs := RemoveDuplicatesAndEmpty(sidss)
 					arrs := RemoveDuplicatesAndEmpty(sidss)
@@ -245,6 +240,12 @@ func (s *Short) Article(stype, id string) error {
 					redis.Put("other", watchKey, newVal, 60*60*24)
 					redis.Put("other", watchKey, newVal, 60*60*24)
 				} else {
 				} else {
 					s.T["canRead"] = false
 					s.T["canRead"] = false
+					for _, v := range sidss {
+						if sid == v {
+							s.T["canRead"] = true
+							break
+						}
+					}
 				}
 				}
 			}
 			}
 		} else {
 		} else {