You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
user_center/routes/api.php

83 lines
3.0 KiB

4 years ago
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::namespace('App\Http\Controllers\Api')->group(function(){
Route::post('auth/login', 'AuthController@login');
Route::post('auth/refresh', 'AuthController@refresh');
Route::post('tool/upload', 'CommonController@upload');
Route::middleware('auth:api')->group(function(){
Route::prefix('auth')->group(function(){
Route::get('scanNode', 'AuthController@scanNode');
Route::post('logout', 'AuthController@logout');
Route::put('modify-password/{id}', 'AuthController@modifyPassword');
Route::put('reset-password/{id}', 'AuthController@resetPassword');
Route::put('employee-auth/{id}', 'AuthController@EmployeeAuth');
Route::put('employee-group-auth/{id}', 'AuthController@EmployeeGroupAuth');
});
Route::apiResources([
'employee-reward-punishment' => EmployeeRewardPunishmentController::class,
'employee-social-items' => EmployeeSocialItemsController::class,
'employee-group' => EmployeeGroupController::class,
'employee-bank' => EmployeeBankController::class,
'sys-setting' => SystemSettingController::class,
'car-info' => CarInfoController::class,
'dictionary' => DictionaryController::class,
'employee' => EmployeeController::class,
'company' => CompanyController::class,
'auth' => AuthController::class,
], ['parameters' => [
'employee-reward-punishment' => 'id',
'employee-social-items' => 'id',
'employee-group' => 'id',
'employee-bank' => 'id',
'sys-setting' => 'id',
'car-info' => 'id',
'dictionary' => 'id',
'employee' => 'id',
'company' => 'id',
'auth' => 'id',
]]);
Route::resources([
'car-brand' => CarBrandController::class,
'car-sub-brand' => CarSubBrandController::class,
'car-man' => CarManController::class,
4 years ago
], [
'only' => ['index', 'store', 'update'],
'parameters' => [
'car-brand' => 'id',
'car-sub-brand' => 'id',
'car-man' => 'id',
]
]);
Route::resources([
'car-series' => CarSeriesController::class,
'car-model' => CarModelController::class,
], [
'except' => ['delete'],
'parameters' => [
4 years ago
'car-series' => 'id',
'car-model' => 'id',
]
]);
});
});