• laravel 中路由的快速设置(只需一个控制器名就ok) 不用具体到方法


    routes/web.php 设置路由

    Route::group(['middleware' => ['iqiyiHttpMiddlewareVerifyCsrfToken::class']], function () {
    //支付订单
    Route::any('order/{action}', function(iqiyiHttpControllersOrder $index, $action,IlluminateHttpRequest $request ){

    return $index->$action($request);
    })->middleware('authAdmin');

    // 报告
    Route::any('report/{action}', function(iqiyiHttpControllersReport $index, $action,IlluminateHttpRequest $request ){

    return $index->$action($request);
    })->middleware('authAdmin');

    // 数据统计
    Route::any('statistics/{action}', function(iqiyiHttpControllersStatistics $index, $action,IlluminateHttpRequest $request ){
    return $index->$action($request);
    })->middleware('authAdmin');
    // 图片管理
    Route::any('img/{action}', function(iqiyiHttpControllersImg $index, $action,IlluminateHttpRequest $request ){

    return $index->$action($request);
    //dump($request);
    })->middleware('authAdmin');
    // 用户管理
    Route::any('user/{action}', function(iqiyiHttpControllersUser $index, $action,IlluminateHttpRequest $request ){

    return $index->$action($request);
    })->middleware('authAdmin');
    // 角色管理
    Route::any('role/{action}', function(iqiyiHttpControllersRole $index, $action,IlluminateHttpRequest $request ){

    return $index->$action($request);
    })->middleware('authAdmin');
    // 菜单管理
    Route::any('menu/{action}', function(iqiyiHttpControllersMenu $index, $action,IlluminateHttpRequest $request ){

    return $index->$action($request);
    })->middleware('authAdmin');


    Route::any('/login', 'Login@index');
    Route::any('logout', 'Login@logout');

    Route::any('/', 'Index@main')->middleware('authAdmin');

    Route::any('import', 'Import@index')->middleware('authAdmin');

    Route::any('import/{action}',function(iqiyiHttpControllersImport $index, $action,IlluminateHttpRequest $request ){
    return $index->$action($request);
    })->middleware('authAdmin');

    Route::any('stock/{action}',function(iqiyiHttpControllersStock $index, $action,IlluminateHttpRequest $request ){
    return $index->$action($request);
    })->middleware('authAdmin');

    Route::get('downreport/{filename}/{expname}', function($filename,$expname) {
    return response()->download(storage_path('report/'.$filename),$expname.'.xls');
    })->middleware('authAdmin');

    // Route::any('channel/{action}',function(iqiyiHttpControllersChannel $index, $action,IlluminateHttpRequest $request ){
    // return $index->$action($request);
    // })->middleware('authAdmin');
    Route::any('importlist', 'Import@lists')->middleware('authAdmin');

    });


    Route::any('order/{action}', function(iqiyiHttpControllersOrder $index, $action,IlluminateHttpRequest $request ){

    return $index->$action($request);
    })->middleware('authAdmin');

  • 相关阅读:
    Using Project Custom Properties to replace all end point of test cases
    Jacoco Code coverage with Robotframework Maven pom.xml example
    Jacoco Code coverage with Robotframework
    Test coverage in a multi module Maven project
    如何让linux的history命令显示时间记录
    项目角色职责分配表
    Linux检查哪些thread在占用CPU
    soapui_mockservicerunner_script.sh
    Some api interface link of Soapui
    GlusterFS分布式存储系统
  • 原文地址:https://www.cnblogs.com/djwhome/p/8865431.html
Copyright © 2020-2023  润新知