*
Showing
1 changed file
with
5 additions
and
1 deletions
... | @@ -38,7 +38,7 @@ class AuthIdentifier | ... | @@ -38,7 +38,7 @@ class AuthIdentifier |
38 | $request->attributes->add(['request_id' => Snowflake::gen(),]); | 38 | $request->attributes->add(['request_id' => Snowflake::gen(),]); |
39 | 39 | ||
40 | $prefix = current(explode('/', $request->path())); | 40 | $prefix = current(explode('/', $request->path())); |
41 | if (!in_array($prefix, $this->auth) || (in_array($request->ip(), explode(',', config('api.inside')['ip'])))) goto AUTH; | 41 | if (!in_array($prefix, $this->auth)) goto AUTH; |
42 | 42 | ||
43 | $identifier = $request->header('identifier'); | 43 | $identifier = $request->header('identifier'); |
44 | 44 | ||
... | @@ -46,6 +46,10 @@ class AuthIdentifier | ... | @@ -46,6 +46,10 @@ class AuthIdentifier |
46 | $identifier = env('identifier'); | 46 | $identifier = env('identifier'); |
47 | } | 47 | } |
48 | 48 | ||
49 | if (empty($identifier) && (in_array($request->ip(), explode(',', config('api.inside')['ip'])))) { | ||
50 | goto AUTH; | ||
51 | } | ||
52 | |||
49 | Log::info(__METHOD__. '解析前:', ['identifier'=>$identifier]); | 53 | Log::info(__METHOD__. '解析前:', ['identifier'=>$identifier]); |
50 | 54 | ||
51 | !empty($identifier) && $identifier = Identifier::resolve($identifier); | 55 | !empty($identifier) && $identifier = Identifier::resolve($identifier); | ... | ... |
-
Please register or sign in to post a comment