更新代码
This commit is contained in:
45
app/Api/ApiServiceProvider.php
Normal file
45
app/Api/ApiServiceProvider.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Api;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class ApiServiceProvider extends ServiceProvider
|
||||
{
|
||||
protected $routeMiddleware = [
|
||||
'auth.api' => Middleware\Authenticate::class,
|
||||
'checkapi' => Middleware\CheckApi::class,
|
||||
];
|
||||
|
||||
public function boot()
|
||||
{
|
||||
}
|
||||
|
||||
public function register()
|
||||
{
|
||||
$this->registerRouteMiddleware();
|
||||
$this->loadAdminRoutes();
|
||||
}
|
||||
|
||||
protected function registerRouteMiddleware()
|
||||
{
|
||||
foreach ($this->routeMiddleware as $key => $middleware) {
|
||||
Route::aliasMiddleware($key, $middleware);
|
||||
}
|
||||
}
|
||||
|
||||
protected function loadAdminRoutes()
|
||||
{
|
||||
Route::middleware('api')
|
||||
->domain('mapi.bohaimingpin.com')
|
||||
->namespace('App\Api\Controllers')
|
||||
->group(__DIR__ . '/routes.php');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user