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)
38
38
$ this ->middleware (['auth:api ' , 'role ' ], ['except ' => ['login ' ]]);
39
39
// 另外关于上面的中间件,官方文档写的是『auth:api』
40
40
// 但是我推荐用 『jwt.auth』,效果是一样的,但是有更加丰富的报错信息返回
41
-
42
- $ perPage = intval ($ request ->input ('perPage ' ));
43
- $ this ->perPage = $ perPage ?? 11 ;
44
-
45
41
}
46
42
47
43
/**
@@ -59,7 +55,7 @@ public function index(Request $request)
59
55
$ where = ['uid ' => $ user_id ];
60
56
}
61
57
$ perPage = intval ($ request ->input ('perPage ' ));
62
- $ perPage = $ perPage ?? 11 ;
58
+ $ perPage = $ perPage ?? 20 ;
63
59
$ list = ApiExcel::with ('apiParam ' )->where ($ where )->orderBy ('id ' , 'desc ' )->paginate ($ perPage );
64
60
// 获取完成进度情况
65
61
$ list = ApiRepository::getInstent ()->workProgress ($ list );
Original file line number Diff line number Diff line change @@ -30,19 +30,18 @@ public function __construct(Request $request)
30
30
$ this ->middleware (['auth:api ' , 'role ' ]);
31
31
// 另外关于上面的中间件,官方文档写的是『auth:api』
32
32
// 但是我推荐用 『jwt.auth』,效果是一样的,但是有更加丰富的报错信息返回
33
-
34
- $ perPage = intval ($ request ->input ('perPage ' ));
35
- $ this ->perPage = $ perPage ?? 11 ;
36
33
}
37
34
38
35
/**
39
36
* Display a listing of the resource.
40
37
*
41
38
* @return \Illuminate\Http\Response
42
39
*/
43
- public function index ()
40
+ public function index (Request $ request )
44
41
{
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 );
46
45
return $ this ->out (200 , $ list );
47
46
}
48
47
You can’t perform that action at this time.
0 commit comments