Ver Fonte

Wesmiler

wesmiler há 3 meses atrás
pai
commit
ab5a14848f
1 ficheiros alterados com 4 adições e 3 exclusões
  1. 4 3
      app/Http/Controllers/Api/v1/IndexController.php

+ 4 - 3
app/Http/Controllers/Api/v1/IndexController.php

@@ -60,8 +60,9 @@ class IndexController extends webApp
     public function data()
     {
         try {
-            $type = request()->post('type',1);
-            $position = request()->post('position',1);
+            $params = request()->all();
+            $type = isset($params['type']) && $params['type']?$params['type'] : 1;
+            $position = isset($params['position']) && $params['position']?$params['position'] : 1;
             $data = [
                 // 轮播
                 'banners' => AdService::make()->getListByPosition($position),
@@ -69,7 +70,7 @@ class IndexController extends webApp
 
             if($type==2){
                 $data['socials'] = SocialCircleService::make()->getIndexList();
-            }else{ 
+            }else{
                 $data['notices'] = NoticeService::make()->getRecommandList();
             }