first commit
This commit is contained in:
52
backend/routes/api.php
Normal file
52
backend/routes/api.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?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::post('auth/login', 'App\Http\Controllers\Auth\Index@login');
|
||||
|
||||
Route::prefix('auth')->middleware(['auth:api'])->group(function ($router) {
|
||||
Route::post('logout', [App\Http\Controllers\Auth\Index::class, 'logout']);
|
||||
Route::post('refresh', [App\Http\Controllers\Auth\Index::class, 'refresh']);
|
||||
Route::get('me', [App\Http\Controllers\Auth\User::class, 'index']);
|
||||
});
|
||||
|
||||
|
||||
Route::prefix('system')->middleware(['auth:api'])->group(function ($router) {
|
||||
Route::get('index/version', [App\Http\Controllers\System\Index::class, 'version']);
|
||||
Route::get('log', [App\Http\Controllers\System\Index::class, 'log']);
|
||||
Route::get('setting', [App\Http\Controllers\System\Setting::class, 'index']);
|
||||
});
|
||||
|
||||
Route::prefix('user')->middleware(['auth:api'])->group(function ($router) {
|
||||
/* 前端菜单 */
|
||||
Route::controller(App\Http\Controllers\Auth\Permission::class)->group(function () {
|
||||
Route::get('menu', 'index');
|
||||
Route::get('menu/my', 'my');
|
||||
Route::post('menu', 'add');
|
||||
Route::put('menu', 'edit');
|
||||
});
|
||||
|
||||
/* 部门路由 */
|
||||
Route::controller(App\Http\Controllers\Auth\Department::class)->group(function () {
|
||||
Route::get('department', 'index');
|
||||
Route::post('department', 'add');
|
||||
Route::put('department', 'edit');
|
||||
});
|
||||
|
||||
/* 用户路由 */
|
||||
Route::controller(App\Http\Controllers\Auth\User::class)->group(function () {
|
||||
Route::get('index', 'index');
|
||||
Route::get('info', 'info');
|
||||
});
|
||||
});
|
||||
18
backend/routes/channels.php
Normal file
18
backend/routes/channels.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Broadcast Channels
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may register all of the event broadcasting channels that your
|
||||
| application supports. The given channel authorization callbacks are
|
||||
| used to check if an authenticated user can listen to the channel.
|
||||
|
|
||||
*/
|
||||
|
||||
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
||||
return (int) $user->id === (int) $id;
|
||||
});
|
||||
19
backend/routes/console.php
Normal file
19
backend/routes/console.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Inspiring;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Console Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This file is where you may define all of your Closure based console
|
||||
| commands. Each Closure is bound to a command instance allowing a
|
||||
| simple approach to interacting with each command's IO methods.
|
||||
|
|
||||
*/
|
||||
|
||||
Artisan::command('inspire', function () {
|
||||
$this->comment(Inspiring::quote());
|
||||
})->purpose('Display an inspiring quote');
|
||||
18
backend/routes/web.php
Normal file
18
backend/routes/web.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::get('/', function () {
|
||||
return view('welcome');
|
||||
});
|
||||
Reference in New Issue
Block a user