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
9aa0f69a
...
9aa0f69a39fe50a42121b540a00c11ec61bd6f8d
authored
2022-12-15 12:56:01 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
*
1 parent
16345b5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
app/Http/Middleware/AuthIdentifier.php
config/api.php
app/Http/Middleware/AuthIdentifier.php
View file @
9aa0f69
...
...
@@ -38,7 +38,7 @@ class AuthIdentifier
$request
->
attributes
->
add
([
'request_id'
=>
Snowflake
::
gen
(),]);
$prefix
=
current
(
explode
(
'/'
,
$request
->
path
()));
if
(
!
in_array
(
$prefix
,
$this
->
auth
))
goto
AUTH
;
if
(
!
in_array
(
$prefix
,
$this
->
auth
)
||
(
in_array
(
$request
->
ip
(),
explode
(
','
,
config
(
'api.inside'
)[
'ip'
])))
)
goto
AUTH
;
$identifier
=
$request
->
header
(
'identifier'
);
...
...
config/api.php
0 → 100644
View file @
9aa0f69
<?php
return
[
'inside'
=>
[
'ip'
=>
env
(
'WHITE_LIST'
,
'121.5.221.142'
),
],
];
Please
register
or
sign in
to post a comment