zhangchangchun 6 years ago
parent
commit
da36a1ca4d
2 changed files with 10 additions and 7 deletions
  1. 3 1
      app/Http/Controllers/V1/ShopController.php
  2. 7 6
      routes/api.php

+ 3 - 1
app/Http/Controllers/V1/ShopController.php

@@ -75,7 +75,7 @@ class ShopController extends Controller {
     //详情
     public function view(Request $request)
     {
-        $data = $request->all();
+        $data = $request->only('shop_id');
         $validator = Validator::make($data, [
             'shop_id' => 'required|integer',
         ]);
@@ -120,4 +120,6 @@ class ShopController extends Controller {
             return $this->jsonError('操作失败');
         }
     }
+
+
 }

+ 7 - 6
routes/api.php

@@ -19,12 +19,7 @@ $api->version('v1', [
     //登录
 
     //$api->post('login', 'AuthController@authenticate');
-    //新增编辑
-    $api->post('addShop', 'ShopController@addShop');
-    //商户详情
-    $api->post('shopView', 'ShopController@view');
-    //商户列表
-    $api->get('shopList', 'ShopController@list');
+
     //登陆
     $api->post('login', 'AuthController@login');
     //获取商户信息
@@ -41,7 +36,13 @@ $api->version('v1', [
     });
 
     $api->group(['middleware' => 'jwt.chxq_auth'], function ($api) {
+        //新增编辑
+        $api->post('addShop', 'ShopController@addShop');
+        //商户列表
+        $api->get('shopList', 'ShopController@list');
         //用户列表
+        //商户详情
+        $api->post('shopView', 'ShopController@view');
 
         $api->get('user', 'UserController@index');
         //用户列表