浏览代码

跳过登录以及权限验证功能允许配置路由别名

jqh 4 年之前
父节点
当前提交
72907b9bd2
共有 2 个文件被更改,包括 8 次插入0 次删除
  1. 4 0
      src/Http/Middleware/Authenticate.php
  2. 4 0
      src/Http/Middleware/Permission.php

+ 4 - 0
src/Http/Middleware/Authenticate.php

@@ -55,6 +55,10 @@ class Authenticate
         );
 
         foreach ($excepts as $except) {
+            if ($request->routeIs($except)) {
+                return true;
+            }
+
             $except = admin_base_path($except);
 
             if ($except !== '/') {

+ 4 - 0
src/Http/Middleware/Permission.php

@@ -107,6 +107,10 @@ class Permission
         );
 
         foreach ($excepts as $except) {
+            if ($request->routeIs($except)) {
+                return true;
+            }
+
             $except = admin_base_path($except);
 
             if ($except !== '/') {