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
f49e83f5
...
f49e83f525a7e7914c7054bd5a32aadd71492d6e
authored
2023-01-09 10:33:30 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
处理数据
1 parent
cfa06383
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
app/Http/Middleware/AuthIdentifier.php
routes/api.php
app/Http/Middleware/AuthIdentifier.php
View file @
f49e83f
...
...
@@ -22,8 +22,9 @@ class AuthIdentifier
/**
* @var string[]
*/
protected
$auth
=
[
'api'
];
protected
$auth
=
[
'api'
,
''
];
protected
$route
=
[
'/song/latestOnlineRecord'
];
/**
* Handle an incoming request.
...
...
@@ -40,6 +41,12 @@ class AuthIdentifier
$prefix
=
current
(
explode
(
'/'
,
$request
->
path
()));
if
(
!
in_array
(
$prefix
,
$this
->
auth
))
goto
AUTH
;
foreach
(
$this
->
route
as
$route
)
{
if
(
strpos
(
$request
->
path
(),
$route
)
!==
false
)
{
goto
AUTH
;
}
}
$identifier
=
$request
->
header
(
'identifier'
);
if
(
env
(
'APP_ENV'
)
==
'local'
&&
empty
(
$identifier
))
{
...
...
routes/api.php
View file @
f49e83f
...
...
@@ -53,7 +53,7 @@ Route::group([], function (){
//发行
Route
::
group
([
"prefix"
=>
"issue"
],
function
(){
Route
::
post
(
'/album/subCompany'
,
'IssueController@subCompany'
);
Route
::
post
(
'{uri}'
,
'IssueController@index'
)
->
where
([
'uri'
=>
'.*+'
]);
Route
::
any
(
'{uri}'
,
'IssueController@index'
)
->
where
([
'uri'
=>
'.*+'
]);
});
//api-v2
...
...
Please
register
or
sign in
to post a comment