File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 44
55use tadmin \controller \Transfer ;
66use tadmin \service \auth \facade \Auth ;
7+ use tadmin \support \controller \Controller ;
78use tauthz \facade \Enforcer ;
89use think \App ;
910
10- class PermissionCheck
11+ class PermissionCheck extends Controller
1112{
1213 protected $ app ;
1314
1415 protected $ request ;
1516
1617 public function __construct (App $ app )
1718 {
18- $ this -> app = $ app ;
19+ parent :: __construct ( $ app) ;
1920 }
2021
2122 public function handle ($ request , \Closure $ next )
@@ -33,8 +34,7 @@ public function handle($request, \Closure $next)
3334 $ enforcer = $ this ->app ->get ('tadmin.enforcer ' );
3435
3536 if (true !== $ enforcer ->enforce ('adminer. ' . $ adminer ->id , $ this ->request ->method (true ), $ this ->parseCurrentPath ())) {
36- return controller (Transfer::class, '' )->message ('权限不足 ' );
37- // throw new \Exception('权限不足');
37+ return $ this ->error ("权限不足 " );
3838 }
3939
4040 return $ next ($ request );
You can’t perform that action at this time.
0 commit comments