baker95935

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 

public function actionGet_permissions()
{
    \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
    return Auth_Item::find()->where(['owner_user_id' => NULL])->all();
}

就是在要输出的代码之前 加上

\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;

 

posted on 2019-05-30 13:50  baker95935  阅读(3819)  评论(0编辑  收藏  举报