new_naweigete/crmeb/basic/BaseController.php
2025-03-12 10:47:34 +08:00

69 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
declare (strict_types=1);
namespace crmeb\basic;
use think\facade\App;
/**
* 控制器基础类
*/
abstract class BaseController
{
/**
* Request实例
* @var \app\Request
*/
protected $request;
/**
* 应用实例
* @var \think\App
*/
protected $app;
/**
* 控制器中间件
* @var array
*/
protected $middleware = [];
/**
* @var
*/
protected $services;
/**
* 需要授权的接口地址
* @var string[]
*/
private $authRule = [];
/**
* 构造方法
* @access public
* @param App $app 应用对象
*/
public function __construct(App $app)
{
$this->app = $app;
$this->request = app('request');
$this->initialize();
}
/**
* @return mixed
*/
abstract protected function initialize();
}