超管后台 - 编辑管理员信息返工

This commit is contained in:
柳清爽
2025-04-17 16:34:04 +08:00
parent 58c51f3262
commit 49900ba9cb
8 changed files with 167 additions and 84 deletions

View File

@@ -10,10 +10,11 @@ use think\Controller;
class BaseController extends Controller
{
/**
* 用户信息
* 管理员信息
*
* @var object
*/
protected $user;
protected $admin;
/**
* 初始化
@@ -26,20 +27,20 @@ class BaseController extends Controller
}
/**
* 获取用户信息
* 获取管理员信息
*
* @param string $column
* @return mixed
* @throws \Exception
*/
protected function getUserInfo(string $column = '')
protected function getAdminInfo(string $column = '')
{
$user = $this->request->userInfo;
$admin = $this->request->adminInfo;
if (!$user) {
if (!$admin) {
throw new \Exception('未授权访问,缺少有效的身份凭证', 401);
}
return $column ? $user[$column] : $user;
return $column ? $admin[$column] : $admin;
}
}