fastadmin在后台登录页监听插件初始化定义的登录事件
修改/application/admin/controller/Index.php的login方法,大约在102行,将:Hook::listen("admin_login_after", $this->request);修改为:
try {
Hook::listen("admin_login_after", $this->request);
} catch(Exception $e) {
$this->error($e->getMessage());
}同时在Index.php顶部引入异常类,代码如下:
use think\Exception;我们需要引入以下类:
use think\Addons;
use think\Session;
use app\admin\library\Auth;
use app\admin\model\AuthGroupAccess;
use app\admin\model\插件\Merchant;
use think\Exception;这样就可以在登录时获取插件内抛出的异常错误。
页:
[1]