Browse Source

修复权限判断无法识别 method:path 格式问题

jqh 4 years ago
parent
commit
d3b32f270d
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/Models/Permission.php

+ 3 - 2
src/Models/Permission.php

@@ -78,13 +78,13 @@ class Permission extends Model implements Sortable
         $method = $this->http_method;
 
         $matches = array_map(function ($path) use ($method) {
-            $path = admin_base_path($path);
-
             if (Str::contains($path, ':')) {
                 [$method, $path] = explode(':', $path);
                 $method = explode(',', $method);
             }
 
+            $path = admin_base_path($path);
+
             return compact('method', 'path');
         }, $this->http_path);
 
@@ -146,6 +146,7 @@ class Permission extends Model implements Sortable
         if (! $path = trim($match['path'], '/')) {
             return false;
         }
+
         if (! Helper::matchRequestPath($path)) {
             return false;
         }