feat : admin driver name

This commit is contained in:
2024-11-11 13:06:07 +08:00
parent 3aba37d426
commit b64d2872ac
10 changed files with 153 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ namespace App\Service\Admin\User;
use App\Cache\Redis\Admin\MenuCache;
use App\Cache\Redis\Admin\RoleCache;
use App\Constants\Admin\AuthCode;
use App\Constants\Common\RoleCode;
use App\Exception\AdminException;
use App\Model\AdminRole;
use App\Model\AdminRoleMenu;
@@ -178,7 +179,7 @@ class RoleService extends BaseService
public function changeStatus(): array
{
$id = (int)$this->request->input('role_id');
if ($id == AuthCode::SUPERADMIN) throw new AdminException('超级管理员不可关闭');
if ($id == RoleCode::SUPER_ADMIN) throw new AdminException('超级管理员不可关闭');
if (!$info = $this->adminRoleModel->getInfoById($id)) throw new AdminException('角色不存在');