Skip to content

Commit 44e819a

Browse files
committed
V1.14
完成文章详细页面
1 parent 5b32c75 commit 44e819a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

frontend/controllers/PostController.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use yii\web\Controller;
99
use yii\web\NotFoundHttpException;
1010
use yii\filters\VerbFilter;
11+
use yii\filters\AccessControl;
1112

1213
use common\models\Tag;
1314
use common\models\Comment;
@@ -31,6 +32,26 @@ public function behaviors()
3132
'delete' => ['POST'],
3233
],
3334
],
35+
36+
37+
'access' =>[
38+
'class' => AccessControl::className(),
39+
'rules' =>
40+
[
41+
[
42+
'actions' => ['index'],
43+
'allow' => true,
44+
'roles' => ['?'],
45+
],
46+
[
47+
'actions' => ['index', 'detail'],
48+
'allow' => true,
49+
'roles' => ['@'],
50+
],
51+
],
52+
],
53+
54+
3455
];
3556
}
3657

0 commit comments

Comments
 (0)