处理数据
Showing
2 changed files
with
9 additions
and
2 deletions
| ... | @@ -22,8 +22,9 @@ class AuthIdentifier | ... | @@ -22,8 +22,9 @@ class AuthIdentifier |
| 22 | /** | 22 | /** |
| 23 | * @var string[] | 23 | * @var string[] |
| 24 | */ | 24 | */ |
| 25 | protected $auth = ['api']; | 25 | protected $auth = ['api', '']; |
| 26 | 26 | ||
| 27 | protected $route = ['/song/latestOnlineRecord']; | ||
| 27 | 28 | ||
| 28 | /** | 29 | /** |
| 29 | * Handle an incoming request. | 30 | * Handle an incoming request. |
| ... | @@ -40,6 +41,12 @@ class AuthIdentifier | ... | @@ -40,6 +41,12 @@ class AuthIdentifier |
| 40 | $prefix = current(explode('/', $request->path())); | 41 | $prefix = current(explode('/', $request->path())); |
| 41 | if (!in_array($prefix, $this->auth)) goto AUTH; | 42 | if (!in_array($prefix, $this->auth)) goto AUTH; |
| 42 | 43 | ||
| 44 | foreach ($this->route as $route) { | ||
| 45 | if (strpos($request->path(), $route) !== false) { | ||
| 46 | goto AUTH; | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 43 | $identifier = $request->header('identifier'); | 50 | $identifier = $request->header('identifier'); |
| 44 | 51 | ||
| 45 | if (env('APP_ENV') == 'local' && empty($identifier)) { | 52 | if (env('APP_ENV') == 'local' && empty($identifier)) { | ... | ... |
| ... | @@ -53,7 +53,7 @@ Route::group([], function (){ | ... | @@ -53,7 +53,7 @@ Route::group([], function (){ |
| 53 | //发行 | 53 | //发行 |
| 54 | Route::group(["prefix"=>"issue"], function (){ | 54 | Route::group(["prefix"=>"issue"], function (){ |
| 55 | Route::post('/album/subCompany', 'IssueController@subCompany'); | 55 | Route::post('/album/subCompany', 'IssueController@subCompany'); |
| 56 | Route::post('{uri}', 'IssueController@index')->where(['uri'=>'.*+']); | 56 | Route::any('{uri}', 'IssueController@index')->where(['uri'=>'.*+']); |
| 57 | }); | 57 | }); |
| 58 | 58 | ||
| 59 | //api-v2 | 59 | //api-v2 | ... | ... |
-
Please register or sign in to post a comment