|
|
@@ -39,6 +39,9 @@ class BaseController extends PublicController
|
|
|
public $validate = true;
|
|
|
|
|
|
protected $service;
|
|
|
+ // 设置允许与不允许方法 shizq 2019-12-05
|
|
|
+ protected $allowActions = [];
|
|
|
+ protected $notAllowActions = [];
|
|
|
|
|
|
public function beforeAction($action)
|
|
|
{
|
|
|
@@ -48,6 +51,12 @@ class BaseController extends PublicController
|
|
|
if (empty($adminId)) {
|
|
|
$this->validate = false;
|
|
|
}
|
|
|
+
|
|
|
+ //方法开放设置 shizq 2019-12-05
|
|
|
+ if (in_array($action->id, $this->notAllowActions)) {
|
|
|
+ util::fail($action->id . ' not allow');
|
|
|
+ }
|
|
|
+
|
|
|
//游客可以访问的方法
|
|
|
if (in_array($action->id, $this->withoutLogin)) {
|
|
|
$this->validate = true;
|