first commit
This commit is contained in:
26
Xboard/app/Http/Controllers/PluginController.php
Normal file
26
Xboard/app/Http/Controllers/PluginController.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Traits\HasPluginConfig;
|
||||
|
||||
/**
|
||||
* 插件控制器基类
|
||||
*
|
||||
* 为所有插件控制器提供通用功能
|
||||
*/
|
||||
abstract class PluginController extends Controller
|
||||
{
|
||||
use HasPluginConfig;
|
||||
|
||||
/**
|
||||
* 执行插件操作前的检查
|
||||
*/
|
||||
protected function beforePluginAction(): ?array
|
||||
{
|
||||
if (!$this->isPluginEnabled()) {
|
||||
return [400, '插件未启用'];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user