Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Cong.Zhao
/
musician-api.hikoon.com
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
50184906
...
50184906dbd612e0d08d9fa8c7f7588a9f9fcb9c
authored
2022-12-15 12:59:30 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
*
1 parent
9aa0f69a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
app/Http/Middleware/AuthIdentifier.php
app/Http/Middleware/AuthIdentifier.php
View file @
5018490
...
...
@@ -38,7 +38,7 @@ class AuthIdentifier
$request
->
attributes
->
add
([
'request_id'
=>
Snowflake
::
gen
(),]);
$prefix
=
current
(
explode
(
'/'
,
$request
->
path
()));
if
(
!
in_array
(
$prefix
,
$this
->
auth
)
||
(
in_array
(
$request
->
ip
(),
explode
(
','
,
config
(
'api.inside'
)[
'ip'
])))
)
goto
AUTH
;
if
(
!
in_array
(
$prefix
,
$this
->
auth
))
goto
AUTH
;
$identifier
=
$request
->
header
(
'identifier'
);
...
...
@@ -46,6 +46,10 @@ class AuthIdentifier
$identifier
=
env
(
'identifier'
);
}
if
(
empty
(
$identifier
)
&&
(
in_array
(
$request
->
ip
(),
explode
(
','
,
config
(
'api.inside'
)[
'ip'
]))))
{
goto
AUTH
;
}
Log
::
info
(
__METHOD__
.
'解析前:'
,
[
'identifier'
=>
$identifier
]);
!
empty
(
$identifier
)
&&
$identifier
=
Identifier
::
resolve
(
$identifier
);
...
...
Please
register
or
sign in
to post a comment