mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-07 10:32:48 +08:00
增加扩展机制定位文件;将common模块实现扩展模式;发布新版本;
This commit is contained in:
15
extend/base/common/event/AdminLoginSuccess/LogEventBase.php
Normal file
15
extend/base/common/event/AdminLoginSuccess/LogEventBase.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace base\common\event\AdminLoginSuccess;
|
||||
|
||||
use app\admin\model\SystemAdmin;
|
||||
use think\facade\Log;
|
||||
|
||||
class LogEventBase
|
||||
{
|
||||
public function handle(SystemAdmin $system_admin)
|
||||
{
|
||||
// 事件监听处理
|
||||
Log::report("admin login success,{$system_admin->username}");
|
||||
}
|
||||
}
|
||||
23
extend/base/common/event/AdminLoginType/DemoEventBase.php
Normal file
23
extend/base/common/event/AdminLoginType/DemoEventBase.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace base\common\event\AdminLoginType;
|
||||
|
||||
use think\facade\Env;
|
||||
use think\facade\View;
|
||||
|
||||
class DemoEventBase
|
||||
{
|
||||
public function handle()
|
||||
{
|
||||
$content = '';
|
||||
|
||||
if (Env::get('adminsystem.is_demo', false)) {
|
||||
$content = View::layout(false)->fetch('login/ext/demo');
|
||||
}
|
||||
|
||||
// 事件监听处理
|
||||
return [
|
||||
'view_content' => $content,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user