|
|
|
@ -11,11 +11,27 @@ use think\Request; |
|
|
|
* @package app\api\controller |
|
|
|
*/ |
|
|
|
abstract class ApiController { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Request实例 |
|
|
|
* @var Request |
|
|
|
*/ |
|
|
|
protected $request; |
|
|
|
/** |
|
|
|
* 构造方法 |
|
|
|
* BaseController constructor. |
|
|
|
* @param App $app |
|
|
|
*/ |
|
|
|
public function __construct(App $app) |
|
|
|
{ |
|
|
|
$this->request = $this->app->request; |
|
|
|
// 控制器初始化 |
|
|
|
$this->initialize(); |
|
|
|
} |
|
|
|
|
|
|
|
// 初始化 |
|
|
|
protected function initialize() |
|
|
|
{ |
|
|
|
} |
|
|
|
/** |
|
|
|
* 返回封装后的 API 数据到客户端 |
|
|
|
* @param int|null $status |
|
|
|
|