From 2afd94b7f486ba769ce2ec87db54ac8eb157a082 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 25 Oct 2019 02:03:31 +0800 Subject: [PATCH] update --- app/Http/Controllers/Server/Controller.php | 17 +++++++++++++++++ .../DeepbworkController.php} | 6 +++--- routes/api.php | 7 +++---- 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 app/Http/Controllers/Server/Controller.php rename app/Http/Controllers/{ServerController.php => Server/DeepbworkController.php} (96%) diff --git a/app/Http/Controllers/Server/Controller.php b/app/Http/Controllers/Server/Controller.php new file mode 100644 index 00000000..a8417ecf --- /dev/null +++ b/app/Http/Controllers/Server/Controller.php @@ -0,0 +1,17 @@ +input('token'); + if (empty($token)) { + abort(500, 'token is null'); + } + if ($token !== config('v2board.server_token')) { + abort(500, 'token is error'); + } + } +} diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/Server/DeepbworkController.php similarity index 96% rename from app/Http/Controllers/ServerController.php rename to app/Http/Controllers/Server/DeepbworkController.php index 7fd09314..dc2edd88 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/Server/DeepbworkController.php @@ -1,16 +1,16 @@ middleware('server') ->group(function () { // Server - Route::get('user', 'ServerController@user'); - Route::post('submit', 'ServerController@submit'); - Route::get('config', 'ServerController@config'); + Route::get('deepbwork/user', 'Server\\DeepbworkController@user'); + Route::post('deepbwork/submit', 'Server\\DeepbworkController@submit'); + Route::get('deepbwork/config', 'Server\\DeepbworkController@config'); }); }); \ No newline at end of file