正在显示
1 个修改的文件
包含
16 行增加
和
3 行删除
| @@ -231,11 +231,24 @@ class IndexController extends BaseController | @@ -231,11 +231,24 @@ class IndexController extends BaseController | ||
| 231 | */ | 231 | */ |
| 232 | public function prInfoDownload() | 232 | public function prInfoDownload() |
| 233 | { | 233 | { |
| 234 | - $url = 'http://crawl.scraper.waimaoq.com/export/issuewire?token=MT0CM7y4tdFTFTm'; | ||
| 235 | - $response = Http::get($url,['page'=>$this->page,'pagesize'=>$this->row]); | 234 | + $url = 'http://crawl.scraper.waimaoq.com/export/issuewire'; |
| 235 | + $response = Http::withHeaders([ | ||
| 236 | + 'Accept' => 'application/json', | ||
| 237 | + ])->get($url, [ | ||
| 238 | + 'page' => $this->page, | ||
| 239 | + 'pagesize' => $this->row, | ||
| 240 | + 'token' => 'MT0CM7y4tdFTFTm' | ||
| 241 | + ]); | ||
| 236 | if ($response->successful()) { | 242 | if ($response->successful()) { |
| 237 | $result = $response->json(); | 243 | $result = $response->json(); |
| 244 | + $this->response('success', Code::SUCCESS, [ | ||
| 245 | + 'url' => $url, | ||
| 246 | + 'list' => $result, | ||
| 247 | + 'page' => $this->page, | ||
| 248 | + 'pagesize' => $this->row | ||
| 249 | + ]); | ||
| 250 | + } else { | ||
| 251 | + $this->response('请求失败', Code::SYSTEM_ERROR, ['status_code' => $response->status(), 'error' => $response->body()]); | ||
| 238 | } | 252 | } |
| 239 | - $this->response('success', Code::SUCCESS, ['url'=>$url,'list'=>$result ?? []]); | ||
| 240 | } | 253 | } |
| 241 | } | 254 | } |
-
请 注册 或 登录 后发表评论