No Description

SourceController.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Http\Controllers;
  3. use GuzzleHttp\Client;
  4. use Illuminate\Foundation\Bus\DispatchesJobs;
  5. use Illuminate\Routing\Controller as BaseController;
  6. use Illuminate\Foundation\Validation\ValidatesRequests;
  7. use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
  8. class SourceController extends BaseController
  9. {
  10. use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
  11. public function getSource()
  12. {
  13. $client = new Client();
  14. $url = 'https://jzsc.mohurd.gov.cn/APi/webApi/dataservice/query/comp/list';
  15. $header = [
  16. 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
  17. 'Referer' => 'https://jzsc.mohurd.gov.cn/data/company',
  18. 'Cookie' => 'Hm_lvt_b1b4b9ea61b6f1627192160766a9c55c=1722159155; HMACCOUNT=770873722DFFDFD2; Hm_lpvt_b1b4b9ea61b6f1627192160766a9c55c=1722160543'
  19. ];
  20. dd($url, $header);
  21. $params = [
  22. 'complexname' => '成都翔威建筑工程有限公司',
  23. 'pg' => 0,
  24. 'pgsz' => 15,
  25. 'total' => 0
  26. ];
  27. $res = $client->request('GET', $url, [
  28. 'query' => $params,
  29. 'headers' => $header
  30. ]);
  31. dd($res);
  32. }
  33. }