public function actionGet_permissions() { Yii::$app->response->format = yiiwebResponse::FORMAT_JSON; return Auth_Item::find()->where(['owner_user_id' => NULL])->all(); }
就是在要输出的代码之前 加上
Yii::$app->response->format = yiiwebResponse::FORMAT_JSON;