浏览代码

catalog limit

zz 6 年之前
父节点
当前提交
d254b97223
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      app/Http/Controllers/Wap/Book/ChapterController.php

+ 7 - 1
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -135,6 +135,9 @@ class ChapterController extends BaseController
      */
     public function getCatalog(Request $request, $t, $domain, $bid)
     {
+        if (!$this->checkUid()) {
+            return response()->error('WAP_NOT_LOGIN');
+        }
         $this->en_bid = $bid;
         $bid = Hashids::decode($bid)[0];
         $lists = ChapterService::getChapterLists($bid);
@@ -229,6 +232,9 @@ class ChapterController extends BaseController
      */
     public function getCatalogPerPage(Request $request, $t, $domain, $bid)
     {
+        if (!$this->checkUid()) {
+            return response()->error('WAP_NOT_LOGIN');
+        }
         $this->en_bid = $bid;
 
         $bid_array = Hashids::decode($bid);
@@ -244,7 +250,7 @@ class ChapterController extends BaseController
         }
         $this->book_info = $book_info;
         $page_size = $request->input('page_size', 15);
-
+        if($page_size>=100) $page_size=100;
         $res = ChapterService::getChapterListsPage($bid, $page_size);
         $is_show_price = $this->showChapterPrice($bid, $book_info->charge_type);
         foreach ($res as $v) {