From 5617640fe6808222c2777552e3f19d7852f4c5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E4=B8=91=E8=B7=AF=E4=BA=BA?= <2278757482@qq.com> Date: Mon, 24 May 2021 20:12:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=98=AFadmin=5Fid=20=3D=201?= =?UTF-8?q?=EF=BC=8C=E9=82=A3=E4=B9=88=E9=BB=98=E8=AE=A4=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Modules/Admin/Services/AuthService.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Modules/Admin/Services/AuthService.php b/app/Modules/Admin/Services/AuthService.php index a276d29..a7058c7 100644 --- a/app/Modules/Admin/Services/AuthService.php +++ b/app/Modules/Admin/Services/AuthService.php @@ -67,6 +67,10 @@ class AuthService extends Service if (!$admin = Auth::guard($this->guard)->user()){ throw new AuthTokenException('认证失败!'); } + // 如果是admin_id = 1,那么默认返回全部权限 + if($admin->admin_id == 1){ + return list_to_tree(AdminMenu::getInstance()->getAllMenus()->toArray()); + } $admin = Admin::with(['roles.menus'])->find($admin->admin_id)->toArray(); $menus = []; -- Gitee