| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 | <?phpnamespace app\admin\controller;use app\common\middleware\WriteLog;use app\common\service\FileService;use app\common\service\RoleService;use app\common\service\ProjectService;use app\common\service\ContractService;use app\common\exception\CatchException;use app\common\service\ProjectStatusService;use app\admin\middleware\CheckPermissionAttr;use app\common\service\ProjectScheduleService;/** * 需要登录 的基类 * Class AuthBase * @package app\api\controller */class BaseAuthorized extends Base{    protected $middleware = [CheckPermissionAttr::class, WriteLog::class];        protected $checkTokenOpen = true;    protected function ProjectService(): ProjectService    {        return (new ProjectService($this->app))->exceptionClass(CatchException::class);    }    protected function ProjectScheduleService(): ProjectScheduleService    {        return (new ProjectScheduleService($this->app))->exceptionClass(CatchException::class);    }    protected function ProjectStatusService(): ProjectStatusService    {        return (new ProjectStatusService($this->app))->exceptionClass(CatchException::class);    }    protected function ContractService(): ContractService    {        return (new ContractService($this->app))->exceptionClass(CatchException::class);    }    protected function FileService(): FileService    {        return (new FileService($this->app))->exceptionClass(CatchException::class);    }    protected function RoleService(): RoleService    {        return (new RoleService($this->app))->exceptionClass(CatchException::class);    }}
 |