amic 8 月之前
父節點
當前提交
451a39ff26
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      controllers/InquirerController.php

+ 8 - 0
controllers/InquirerController.php

@@ -11,6 +11,14 @@ class InquirerController extends \yii\web\Controller
         return $this->render('index');
     }
 
+    public function beforeAction($action)
+	{
+		if (in_array($action->id, ['ajax'])) {
+			$this->enableCsrfValidation = false;
+		}
+		return parent::beforeAction($action);
+	}
+
     public function actionView($id){
 		$model = Inquirer::findOne(['id'=>$id]);