<?php

/*
|--------------------------------------------------------------------------
| 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::any('/wx/home','HomeController@getIndex')->name('wxIndex');

Route::prefix('service')->group(function() {
    Route::post('/get_authcode', 'ToolController@authcode');
    Route::post('/check_sms_authcode', 'ToolController@checkSmsAuthcode');
});

Route::namespace('WX')->group(function() {
    Route::any('/verity/wx','HomeController@getVerityWX');
});

Route::namespace('Card')->group(function() {
    Route::get('/', 'HomeController@getHome')->name('index'); //微信公众号明信片
});

Route::prefix('admin')->namespace('Admin')->group(function() {
    Route::get('/login', 'AdminController@getLogin')->name('adminLogin');
    Route::post('/post/login', 'AdminController@getPostLogin');
});

Route::prefix('admin')->namespace('Admin')->middleware('check.adminLogin')->group(function() {
    Route::get('/image/list', 'AdminController@getImgList')->name('checkImg');
    Route::post('/save/status', 'AdminController@getSaveStatus');
    Route::post('/save/status/all', 'AdminController@getSaveStatusAll');
});


Route::namespace('Platform')->group(function() {
    Route::get('/login', 'HomeController@showLoginForm')->name('login');
    Route::post('/login', 'UserController@login');

    Route::get('/ald_login', 'HomeController@showAldLoginForm');
    Route::post('/ald_login', 'AldUserController@login');

    Route::get('/register', 'HomeController@showRegisterForm')->name('register');
    Route::post('/register', 'UserController@register');

    Route::get('/find_password', 'HomeController@showFindPasswordForm')->name('find_password');
    Route::post('/password/getback', 'PasswordController@getback');

    Route::get('/ald_user_report', 'AldUserController@userReport');
    Route::post('/mobile_login', 'UserController@mobileLogin');

});

Route::namespace('Platform')->middleware('check.login')->group(function () {
    Route::get('/logout', 'UserController@logout')->name('logout');
    Route::post('/user/bind_aldzn', 'UserController@bindALD');
    Route::any('/get_role_list', 'AldUserController@getRoleList');
    Route::post('/send_role_gift', 'AldUserController@sendRoleGift');
    Route::get('/ald_bind_info', 'AldUserController@bindInfo');
});

Route::namespace('WX')->middleware('check.login')->group(function() {
    Route::get('/bind/ald/code','SignController@getBindAldCode')->name('aldCode');//绑定阿拉德码
});

Route::namespace('Card')->middleware('check.login')->group(function() {
    Route::post('/bind/ald/role','CardController@getBindAldRole');//绑定角色
    Route::post('/upload/img','CardController@getUploadImg');//上传用户图片
    Route::get('/card/html','CardController@getCardHtml');//明信片页面
    Route::get('/wx/config','WxController@getWxConfig');//获取微信分享参数
});
