dyjh 6 年之前
父节点
当前提交
b0a2c11395
共有 2 个文件被更改,包括 35 次插入63 次删除
  1. 1 60
      routes/api.php
  2. 34 3
      routes/web.php

+ 1 - 60
routes/api.php

xqd
@@ -17,66 +17,7 @@ use Illuminate\Http\Request;
 //    return $request->user();
 //});
 
-if (strpos(request()->getRequestUri(), 'api') !== false) {
-    //$api = app('Dingo\Api\Routing\Router');
-    /*   $api->version('v1', ['namespace' => 'App\Http\Controllers'], function ($api) {
-           $api->group(['middleware' => ['auth.api']], function ($api) {*/
-// Furniture::parseRoute();
-    //$route_url = $_SESSION['route'];
-    $route_url = request()->input('route');
-    if (isset($apiRoute[$route_url])) {
-        $route_url_r = $apiRoute[$route_url]['real'];
-        $route_url_r = ucfirst($route_url_r);
-        $route = $baseRoute = explode('/',$route_url_r);
-        if (count($route) > 1) {
-            unset($route[count($route) - 1]);
-            $file = app_path() . '/Http/Controllers/' . implode("/", $route) . "Controller.php";
-            if (file_exists($file)) {
-                $controller = implode("\\", $route) . "Controller";
-                $action = $controller . "@" . $baseRoute[count($route)];
-                dd($action);
-                if ($apiRoute[$route_url]['auth'] == true) {
-                    Route::middleware(['auth.api'])->group(function () use ($action, $route, $auth, $route_url) {
-                        switch ($auth[$route_url]['method']) {
-                            case 'get':
-                                Route::get('/', ['as' => $route[0],
-                                    'uses' => $action]);
-                                break;
-                            case 'post':
-                                Route::post('/', ['as' => $route[0],
-                                    'uses' => $action]);
-                                break;
-                            case 'any':
-                                Route::any('/', ['as' => $route[0],
-                                    'uses' => $action]);
-                                break;
-                        }
-                    });
-                } else {
-                    switch ($apiRoute[$route_url]['method']) {
-                        case 'get':
-                            Route::get('/', ['as' => $route[0],
-                                'uses' => $action]);
-                            break;
-                        case 'post':
-                            Route::post('/', ['as' => $route[0],
-                                'uses' => $action]);
-                            break;
-                        case 'any':
-                            Route::any('/', ['as' => $route[0],
-                                'uses' => $action]);
-                            break;
-                    }
-                }
-
-            }
-        }
-    }
-
-    /*    });
-    });*/
-
-}
+
 
 //
 $api = app('Dingo\Api\Routing\Router');

+ 34 - 3
routes/web.php

xqd
@@ -12,9 +12,40 @@
 
 $apiRoute = [
     'api/album/get-banner' => ['real' => 'Api/V1/Album/albumGetBanner','method'=>'get','auth'=>false],
-    'Api/V1/Album/albumCat' => 'get',
-    'Api/V1/Album/albumXyxLogin' => 'post',
-    'Api/V1/Album/albumSetting' => 'get'
+    'api/album/xyx_login' => ['real' => 'Api/V1/Album/albumXyxLogin','method'=>'post','auth'=>false],
+    'api/album/cat' => ['real' => 'Api/V1/Album/albumCat','method'=>'get','auth'=>false],
+    'api/album/album/setting' => ['real' => 'Api/V1/Album/albumSetting','method'=>'get','auth'=>false],
+    'api/album/customer-goods' => ['real' => 'Api/V1/Album/albumCustomerGoods','method'=>'post','auth'=>true],
+    'api/album/customer-goods-detail' => ['real' => 'Api/V1/Album/albumCustomerGoodsDetail','method'=>'post','auth'=>true],
+    'api/album/album/get-count-favorite' => ['real' => 'Api/V1/Album/albumGetCountOfFavorite','method'=>'post','auth'=>true],
+    'api/album_boss/get_top' => ['real' => 'Api/V1/AlbumBoss/getTop','method'=>'get','auth'=>true],
+    'api/album_boss/agent_customer' => ['real' => 'Api/V1/AlbumBoss/agentCustomer','method'=>'post','auth'=>true],
+    'api/album_boss/agent_statistical' => ['real' => 'Api/V1/AlbumBoss/agentStatistical','method'=>'post','auth'=>true],
+    'api/album_boss/agent_overview_active' => ['real' => 'Api/V1/AlbumBoss/albumOverviewActive','method'=>'post','auth'=>true],
+    'api/album_boss/agent_overview_left' => ['real' => 'Api/V1/AlbumBoss/albumOverviewLeft','method'=>'post','auth'=>true],
+    'api/album_boss/agent_overview_favorite' => ['real' => 'Api/V1/AlbumBoss/albumOverviewFavorite','method'=>'post','auth'=>true],
+    'api/album_boss/agent_overview_new' => ['real' => 'Api/V1/AlbumBoss/albumOverviewNew','method'=>'post','auth'=>true],
+    'api/album_boss/agent_analysis' => ['real' => 'Api/V1/AlbumBoss/agentAnalysis','method'=>'post','auth'=>true],
+    'api/album_boss/agent_overview_call' => ['real' => 'Api/V1/AlbumBoss/albumOverviewCall','method'=>'post','auth'=>true],
+    'api/album_boss/agent_overview_funnel' => ['real' => 'Api/V1/AlbumBoss/albumOverviewFunnel','method'=>'post','auth'=>true],
+    'api/album_boss/boss_interactive' => ['real' => 'Api/V1/AlbumBoss/BossInteractive','method'=>'get','auth'=>true],
+    'api/album/get_data_goods' => ['real' => 'Api/V1/Album/albumGetDataGoods','method'=>'post','auth'=>true],
+    'api/album_post/info' => ['real' => 'Api/V1/AlbumPoster/posterInfo','method'=>'post','auth'=>true],
+    'api/album_post/download' => ['real' => 'Api/V1/AlbumPoster/posterDownload','method'=>'post','auth'=>true],
+    'api/album/get-customer' => ['real' => 'Api/V1/Album/albumGetCustomer','method'=>'get','auth'=>true],
+    'api/album/set-customer' => ['real' => 'Api/V1/Album/albumSetCustomer','method'=>'post','auth'=>true],
+    'api/album/statistical' => ['real' => 'Api/V1/Album/albumStatistical','method'=>'post','auth'=>true],
+    'api/album/get_statistical' => ['real' => 'Api/V1/Album/albumGetStatistical','method'=>'post','auth'=>true],
+    'api/album/get_data_cat' => ['real' => 'Api/V1/Album/albumGetDataCat','method'=>'post','auth'=>true],
+    'api/album/get_data_cat_single' => ['real' => 'Api/V1/Album/albumGetDataCatSingle','method'=>'post','auth'=>true],
+    'api/album/favorite_list' => ['real' => 'Api/V1/Album/albumFavoriteList','method'=>'get','auth'=>true],
+    'api/album/favorite_del' => ['real' => 'Api/V1/Album/albumFavoriteDel','method'=>'get','auth'=>true],
+    'api/album/get_user_info' => ['real' => 'Api/V1/Album/albumGetUserInfo','method'=>'get','auth'=>true],
+    'api/album/goods' => ['real' => 'Api/V1/Album/albumGoods','method'=>'get','auth'=>true],
+    'api/album/goods-detail' => ['real' => 'Api/V1/Album/albumGoodsDetail','method'=>'get','auth'=>true],
+    'api/album/set-price' => ['real' => 'Api/V1/Album/albumSetPrice','method'=>'get','auth'=>true],
+
+
 ];
 /*$auth = [
     'Api/V1/Album/albumGoods' => 'post',