*
Showing
3 changed files
with
10 additions
and
3 deletions
... | @@ -15,6 +15,10 @@ use Illuminate\Http\Request; | ... | @@ -15,6 +15,10 @@ use Illuminate\Http\Request; |
15 | */ | 15 | */ |
16 | class AuthIdentifier | 16 | class AuthIdentifier |
17 | { | 17 | { |
18 | protected $auth = [ | ||
19 | 'api' | ||
20 | ]; | ||
21 | |||
18 | /** | 22 | /** |
19 | * Handle an incoming request. | 23 | * Handle an incoming request. |
20 | * | 24 | * |
... | @@ -24,6 +28,9 @@ class AuthIdentifier | ... | @@ -24,6 +28,9 @@ class AuthIdentifier |
24 | */ | 28 | */ |
25 | public function handle(Request $request, Closure $next) | 29 | public function handle(Request $request, Closure $next) |
26 | { | 30 | { |
31 | $prefix = current(explode('/', $request->path())); | ||
32 | if (!in_array($prefix, $this->auth)) goto AUTH; | ||
33 | |||
27 | $identifier = $request->header('identifier'); | 34 | $identifier = $request->header('identifier'); |
28 | 35 | ||
29 | if (env('APP_ENV') == 'local' && empty($identifier)) { | 36 | if (env('APP_ENV') == 'local' && empty($identifier)) { |
... | @@ -45,6 +52,8 @@ class AuthIdentifier | ... | @@ -45,6 +52,8 @@ class AuthIdentifier |
45 | 'stakeholder_ids' => $stakeholder_ids, | 52 | 'stakeholder_ids' => $stakeholder_ids, |
46 | ]); | 53 | ]); |
47 | 54 | ||
55 | AUTH: | ||
56 | |||
48 | return $next($request); | 57 | return $next($request); |
49 | } | 58 | } |
50 | } | 59 | } | ... | ... |
... | @@ -13,9 +13,6 @@ use Illuminate\Support\Facades\Route; | ... | @@ -13,9 +13,6 @@ use Illuminate\Support\Facades\Route; |
13 | | | 13 | | |
14 | */ | 14 | */ |
15 | Route::group([], function (){ | 15 | Route::group([], function (){ |
16 | |||
17 | Route::get('musician/xxx1', 'MusicianWithdrawController@withdraw'); | ||
18 | |||
19 | //提现审核通过 | 16 | //提现审核通过 |
20 | Route::post('musician/withdraw', 'MusicianWithdrawController@withdraw'); | 17 | Route::post('musician/withdraw', 'MusicianWithdrawController@withdraw'); |
21 | }); | 18 | }); | ... | ... |
-
Please register or sign in to post a comment