chore: 增强异常输出并在初始化阶段支持管理员上下文模拟
这个提交包含在:
@@ -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();
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户