blessing-skin-server/routes/web.php

131 lines
4.8 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', 'AuthController@reset');
2016-07-21 22:01:57 +08:00
});
Route::any('/logout', 'AuthController@logout');
Route::any('/captcha', 'AuthController@captcha');
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', 'AuthController@handleReset');
2016-07-21 22:01:57 +08:00
});
/**
* User Center
*/
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
Route::view('/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' => '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');
Route::get ('/user-data', 'AdminController@getUserData');
2016-12-31 13:07:00 +08:00
Route::view('/players', 'admin.players');
Route::get ('/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
});