File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -155,9 +155,13 @@ func (TopicController) Detail(ctx echo.Context) error {
155
155
"activeTopics" : "active" ,
156
156
"topic" : topic ,
157
157
"replies" : replies ,
158
+ "appends" : []* model.TopicAppend {},
158
159
}
159
160
160
161
me , ok := ctx .Get ("user" ).(* model.Me )
162
+ if topic ["permission" ] == 0 || (topic ["permission" ] == 1 && ok ) {
163
+ data ["appends" ] = logic .DefaultTopic .FindAppend (ctx , tid )
164
+ }
161
165
if ok {
162
166
tid := topic ["tid" ].(int )
163
167
data ["likeflag" ] = logic .DefaultLike .HadLike (ctx , me .Uid , tid , model .TypeTopic )
@@ -177,8 +181,6 @@ func (TopicController) Detail(ctx echo.Context) error {
177
181
logic .Views .Incr (Request (ctx ), model .TypeTopic , tid )
178
182
}
179
183
180
- data ["appends" ] = logic .DefaultTopic .FindAppend (ctx , tid )
181
-
182
184
return render (ctx , "topics/detail.html,common/comment.html" , data )
183
185
}
184
186
You can’t perform that action at this time.
0 commit comments