2016-07-21 22:01:57 +08:00
|
|
|
<?php
|
2016-08-28 10:05:21 +08:00
|
|
|
|
2016-07-21 22:01:57 +08:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Application Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register all of the routes for an application.
|
2016-08-28 10:05:21 +08:00
|
|
|
| It's a breeze. Simply tell Laravel the URIs it should respond to
|
|
|
|
| and give it the controller to call when that URI is requested.
|
2016-07-21 22:01:57 +08:00
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::get('/', 'HomeController@index');
|
|
|
|
Route::get('/index.php', 'HomeController@index');
|
|
|
|
|
|
|
|
Route::get('/locale/{lang}', 'HomeController@locale');
|
2016-09-14 23:27:02 +08:00
|
|
|
|
2016-07-21 22:01:57 +08:00
|
|
|
/**
|
|
|
|
* Auth
|
|
|
|
*/
|
2016-11-18 16:46:58 +08:00
|
|
|
Route::group(['prefix' => 'auth'], function ()
|
2016-07-21 22:01:57 +08:00
|
|
|
{
|
2016-11-18 16:46:58 +08:00
|
|
|
Route::group(['middleware' => 'guest'], function ()
|
2016-07-21 22:01:57 +08:00
|
|
|
{
|
2018-07-18 11:04:34 +08:00
|
|
|
Route::view('/login', 'auth.login');
|
|
|
|
Route::get ('/register', 'AuthController@register');
|
|
|
|
Route::get ('/forgot', 'AuthController@forgot');
|
|
|
|
Route::get ('/reset/{uid}', 'AuthController@reset')->name('auth.reset')->middleware('signed');
|
2016-07-21 22:01:57 +08:00
|
|
|
});
|
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::any('/logout', 'AuthController@logout');
|
|
|
|
Route::any('/captcha', 'AuthController@captcha');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::post('/login', 'AuthController@handleLogin');
|
|
|
|
Route::post('/register', 'AuthController@handleRegister');
|
|
|
|
Route::post('/forgot', 'AuthController@handleForgot');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2018-07-18 11:04:34 +08:00
|
|
|
Route::post('/reset/{uid}', 'AuthController@handleReset')->middleware('signed');
|
2016-07-21 22:01:57 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* User Center
|
|
|
|
*/
|
2016-11-18 16:46:58 +08:00
|
|
|
Route::group(['middleware' => 'auth', 'prefix' => 'user'], function ()
|
2016-07-21 22:01:57 +08:00
|
|
|
{
|
2016-08-28 10:05:21 +08:00
|
|
|
Route::any ('', 'UserController@index');
|
2017-07-14 09:17:42 +08:00
|
|
|
Route::any ('/sign', 'UserController@sign');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
|
|
|
// Profile
|
|
|
|
Route::get ('/profile', 'UserController@profile');
|
|
|
|
Route::post('/profile', 'UserController@handleProfile');
|
|
|
|
Route::post('/profile/avatar', 'UserController@setAvatar');
|
|
|
|
|
|
|
|
// Player
|
2016-08-28 10:05:21 +08:00
|
|
|
Route::any ('/player', 'PlayerController@index');
|
2016-07-21 22:01:57 +08:00
|
|
|
Route::post('/player/add', 'PlayerController@add');
|
2017-11-14 23:25:04 +08:00
|
|
|
Route::any ('/player/show', 'PlayerController@show');
|
2016-07-21 22:01:57 +08:00
|
|
|
Route::post('/player/preference', 'PlayerController@setPreference');
|
|
|
|
Route::post('/player/set', 'PlayerController@setTexture');
|
|
|
|
Route::post('/player/texture/clear', 'PlayerController@clearTexture');
|
|
|
|
Route::post('/player/rename', 'PlayerController@rename');
|
|
|
|
Route::post('/player/delete', 'PlayerController@delete');
|
|
|
|
|
|
|
|
// Closet
|
2018-07-17 17:25:54 +08:00
|
|
|
Route::get ('/closet', 'ClosetController@index');
|
2017-04-23 23:58:22 +08:00
|
|
|
Route::get ('/closet-data', 'ClosetController@getClosetData');
|
2016-07-21 22:01:57 +08:00
|
|
|
Route::post('/closet/add', 'ClosetController@add');
|
|
|
|
Route::post('/closet/remove', 'ClosetController@remove');
|
2016-09-25 10:35:16 +08:00
|
|
|
Route::post('/closet/rename', 'ClosetController@rename');
|
2016-07-21 22:01:57 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Skin Library
|
|
|
|
*/
|
2016-11-18 16:46:58 +08:00
|
|
|
Route::group(['prefix' => 'skinlib'], function ()
|
2016-07-21 22:01:57 +08:00
|
|
|
{
|
2017-06-30 10:33:41 +08:00
|
|
|
Route::get('', 'SkinlibController@index');
|
|
|
|
Route::any('/info/{tid}', 'SkinlibController@info');
|
|
|
|
Route::any('/show/{tid}', 'SkinlibController@show');
|
|
|
|
Route::any('/data', 'SkinlibController@getSkinlibFiltered');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2016-11-18 16:46:58 +08:00
|
|
|
Route::group(['middleware' => 'auth'], function ()
|
2016-07-21 22:01:57 +08:00
|
|
|
{
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::get ('/upload', 'SkinlibController@upload');
|
|
|
|
Route::post('/upload', 'SkinlibController@handleUpload');
|
2016-07-21 22:01:57 +08:00
|
|
|
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::post('/rename', 'SkinlibController@rename');
|
2017-01-22 15:45:10 +08:00
|
|
|
Route::post('/privacy', 'SkinlibController@privacy');
|
2016-09-24 22:45:54 +08:00
|
|
|
Route::post('/delete', 'SkinlibController@delete');
|
2016-07-21 22:01:57 +08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-22 19:36:24 +08:00
|
|
|
/**
|
|
|
|
* Admin Panel
|
|
|
|
*/
|
2016-11-18 16:46:58 +08:00
|
|
|
Route::group(['middleware' => 'admin', 'prefix' => 'admin'], function ()
|
2016-07-22 19:36:24 +08:00
|
|
|
{
|
2016-12-31 13:07:00 +08:00
|
|
|
Route::get('/', 'AdminController@index');
|
2016-07-22 19:36:24 +08:00
|
|
|
|
2016-12-31 13:07:00 +08:00
|
|
|
Route::any('/customize', 'AdminController@customize');
|
|
|
|
Route::any('/score', 'AdminController@score');
|
|
|
|
Route::any('/options', 'AdminController@options');
|
2016-11-25 12:54:20 +08:00
|
|
|
|
2018-07-17 17:17:31 +08:00
|
|
|
Route::view('/users', 'admin.users');
|
|
|
|
Route::get ('/user-data', 'AdminController@getUserData');
|
2016-12-31 13:07:00 +08:00
|
|
|
|
2018-07-17 17:17:31 +08:00
|
|
|
Route::view('/players', 'admin.players');
|
|
|
|
Route::get ('/player-data', 'AdminController@getPlayerData');
|
|
|
|
Route::get ('/user/{uid}', 'AdminController@getOneUser');
|
2016-12-31 11:38:07 +08:00
|
|
|
|
2016-07-23 15:20:10 +08:00
|
|
|
// ajax handlers
|
2016-12-31 13:07:00 +08:00
|
|
|
Route::post('/users', 'AdminController@userAjaxHandler');
|
|
|
|
Route::post('/players', 'AdminController@playerAjaxHandler');
|
2016-12-17 19:52:59 +08:00
|
|
|
|
|
|
|
Route::group(['prefix' => 'plugins'], function () {
|
2017-01-17 21:41:20 +08:00
|
|
|
Route::get ('/data', 'PluginController@getPluginData');
|
2018-07-17 17:17:31 +08:00
|
|
|
Route::redirect('/market', 'https://github.com/printempw/blessing-skin-server/wiki/Plugins');
|
2017-01-17 21:41:20 +08:00
|
|
|
|
2018-07-17 17:17:31 +08:00
|
|
|
Route::view('/manage', 'admin.plugins');
|
2017-01-17 21:41:20 +08:00
|
|
|
Route::post('/manage', 'PluginController@manage');
|
|
|
|
Route::any ('/config/{name}', 'PluginController@config');
|
2016-12-17 19:52:59 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
Route::group(['prefix' => 'update'], function () {
|
2016-12-18 17:32:46 +08:00
|
|
|
Route::any('', 'UpdateController@showUpdatePage');
|
|
|
|
Route::get('/check', 'UpdateController@checkUpdates');
|
|
|
|
Route::any('/download', 'UpdateController@download');
|
2016-12-17 19:52:59 +08:00
|
|
|
});
|
2016-07-22 19:36:24 +08:00
|
|
|
});
|