blessing-skin-server/routes/web.php

133 lines
5.1 KiB
PHP
Raw Normal View History

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
|
*/
Route::get('/', 'HomeController@index');
Route::get('/index.php', 'HomeController@index');
Route::get('/locale/{lang}', 'HomeController@locale');
2016-07-21 22:01:57 +08:00
/**
* Auth
*/
Route::group(['prefix' => 'auth'], function ()
2016-07-21 22:01:57 +08:00
{
Route::group(['middleware' => 'guest'], function ()
2016-07-21 22:01:57 +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
});
Route::any('/logout', 'AuthController@logout');
2018-07-21 08:21:42 +08:00
Route::any('/captcha', '\Mews\Captcha\CaptchaController@getCaptcha');
2016-07-21 22:01:57 +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
Route::post('/reset/{uid}', 'AuthController@handleReset')->middleware('signed');
2016-07-21 22:01:57 +08:00
});
/**
* User Center
*/
Route::group(['middleware' => ['web', 'auth'], 'prefix' => 'user'], function ()
2016-07-21 22:01:57 +08:00
{
2016-08-28 10:05:21 +08:00
Route::any ('', 'UserController@index');
2018-08-08 09:50:35 +08:00
Route::get ('/score-info', 'UserController@scoreInfo');
2018-08-07 09:54:56 +08:00
Route::post('/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');
2018-07-30 15:45:08 +08:00
Route::get ('/player/list', 'PlayerController@listAll');
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');
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
*/
Route::group(['prefix' => 'skinlib'], function ()
2016-07-21 22:01:57 +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
Route::group(['middleware' => 'auth'], function ()
2016-07-21 22:01:57 +08:00
{
Route::get ('/upload', 'SkinlibController@upload');
Route::post('/upload', 'SkinlibController@handleUpload');
2016-07-21 22:01:57 +08:00
Route::post('/rename', 'SkinlibController@rename');
Route::post('/privacy', 'SkinlibController@privacy');
Route::post('/delete', 'SkinlibController@delete');
2016-07-21 22:01:57 +08:00
});
});
2016-07-22 19:36:24 +08:00
/**
* Admin Panel
*/
Route::group(['middleware' => ['auth', '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');
Route::view('/users', 'admin.users');
2018-08-13 11:08:14 +08:00
Route::any ('/user-data', 'AdminController@getUserData');
2016-12-31 13:07:00 +08:00
Route::view('/players', 'admin.players');
2018-08-13 11:08:14 +08:00
Route::any ('/player-data', 'AdminController@getPlayerData');
Route::get ('/user/{uid}', 'AdminController@getOneUser');
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');
Route::redirect('/market', 'https://github.com/printempw/blessing-skin-server/wiki/Plugins');
2017-01-17 21:41:20 +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 () {
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
});