File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
laravel/app/Http/Controllers/Api Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,6 @@ public function __construct(Request $request)
3838 $ this ->middleware (['auth:api ' , 'role ' ], ['except ' => ['login ' ]]);
3939 // 另外关于上面的中间件,官方文档写的是『auth:api』
4040 // 但是我推荐用 『jwt.auth』,效果是一样的,但是有更加丰富的报错信息返回
41-
42- $ perPage = intval ($ request ->input ('perPage ' ));
43- $ this ->perPage = $ perPage ?? 11 ;
44-
4541 }
4642
4743 /**
@@ -59,7 +55,7 @@ public function index(Request $request)
5955 $ where = ['uid ' => $ user_id ];
6056 }
6157 $ perPage = intval ($ request ->input ('perPage ' ));
62- $ perPage = $ perPage ?? 11 ;
58+ $ perPage = $ perPage ?? 20 ;
6359 $ list = ApiExcel::with ('apiParam ' )->where ($ where )->orderBy ('id ' , 'desc ' )->paginate ($ perPage );
6460 // 获取完成进度情况
6561 $ list = ApiRepository::getInstent ()->workProgress ($ list );
Original file line number Diff line number Diff line change @@ -30,19 +30,18 @@ public function __construct(Request $request)
3030 $ this ->middleware (['auth:api ' , 'role ' ]);
3131 // 另外关于上面的中间件,官方文档写的是『auth:api』
3232 // 但是我推荐用 『jwt.auth』,效果是一样的,但是有更加丰富的报错信息返回
33-
34- $ perPage = intval ($ request ->input ('perPage ' ));
35- $ this ->perPage = $ perPage ?? 11 ;
3633 }
3734
3835 /**
3936 * Display a listing of the resource.
4037 *
4138 * @return \Illuminate\Http\Response
4239 */
43- public function index ()
40+ public function index (Request $ request )
4441 {
45- $ list = ApiParam::orderBy ('id ' , 'desc ' )->paginate ($ this ->perPage );
42+ $ perPage = intval ($ request ->input ('perPage ' ));
43+ $ perPage = $ perPage ?? 20 ;
44+ $ list = ApiParam::orderBy ('id ' , 'desc ' )->paginate ($ perPage );
4645 return $ this ->out (200 , $ list );
4746 }
4847
You can’t perform that action at this time.
0 commit comments