api增加登录用户的信息

This commit is contained in:
hdm 2023-03-02 11:21:41 +08:00
parent 422a4bc995
commit 7dbe36dac5

View File

@ -14,6 +14,7 @@ use think\exception\HttpResponseException;
use think\facade\Request; use think\facade\Request;
use think\facade\Session; use think\facade\Session;
use think\facade\View; use think\facade\View;
use think\facade\Db;
use think\Response; use think\Response;
/** /**
@ -100,6 +101,8 @@ abstract class BaseController
} }
else{ else{
$this->uid = Session::get($session_admin); $this->uid = Session::get($session_admin);
$login_admin = Db::name('Admin')->where(['id' => $this->uid])->find();
View::assign('login_admin', $login_admin);
} }
} }
/** /**