Skip to content

Commit 85358f3

Browse files
committed
alter
后台权限验证中间件修改,注释没用属性except、修改超级管理员绕过gate验证说明
1 parent 86248b2 commit 85358f3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

app/Http/Middleware/AuthenticateAdmin.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
class AuthenticateAdmin
1212
{
13-
14-
protected $except = [
15-
'admin/index'
16-
];
13+
//改属性经测试没用?
14+
// protected $except = [
15+
// 'admin/index'
16+
// ];
1717

1818
/**
1919
* Handle an incoming request.
@@ -23,7 +23,8 @@ class AuthenticateAdmin
2323
*/
2424
public function handle($request, Closure $next)
2525
{
26-
//超级管理员已经在AuthServiceProvider.php 通过所有权限验证,故不需要再验证
26+
// dd(Route::currentRouteName());
27+
//超级管理员已经在AuthServiceProvider.php 通过所有权限验证,下面gate权限验证里会自动true绕过,这里不需要再验证?,不想经过下面Gate验证能节省资源能开启?
2728
// if(Auth::guard('admin')->user()->id === 1){
2829
// return $next($request);
2930
// }

0 commit comments

Comments
 (0)