From 39aaf4e82168a20ee915a6fc2c4333b38f3914db 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:54:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=9D=83=E9=99=90=E4=B9=8B=E5=90=8E=EF=BC=8C=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=88=97=E8=A1=A8=EF=BC=88=E5=90=A6=E5=88=99?= =?UTF-8?q?=E5=86=8D=E6=AC=A1=E7=82=B9=E5=87=BB=E7=BC=96=E8=BE=91=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=95=B0=E6=8D=AE=E6=B8=B2=E6=9F=93=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/vue-element-admin/views/admin_roles/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Modules/Admin/Resources/vue-element-admin/views/admin_roles/index.vue b/app/Modules/Admin/Resources/vue-element-admin/views/admin_roles/index.vue index fe8450e..f0924d1 100644 --- a/app/Modules/Admin/Resources/vue-element-admin/views/admin_roles/index.vue +++ b/app/Modules/Admin/Resources/vue-element-admin/views/admin_roles/index.vue @@ -395,7 +395,7 @@ } } - if (!this.role.role_id) this.getList(); + if (this.role.role_id) this.getList(); break; default: this.$notify({ -- Gitee From c73cd99dd32cd2bd37911d238826c2b36a8dc2cb 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:54:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=98=AFadmin=5Fid=20=3D?= =?UTF-8?q?=201=EF=BC=8C=E9=82=A3=E4=B9=88=E9=BB=98=E8=AE=A4=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=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 75dbcc7..a290e26 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