No Description

SourceController.php 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. $time = time();
  15. $url = 'https://jzsc.mohurd.gov.cn/APi/webApi/dataservice/query/comp/list';
  16. $header = [
  17. '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',
  18. 'Referer' => 'https://jzsc.mohurd.gov.cn/data/company',
  19. 'Cookie' => 'Hm_lvt_b1b4b9ea61b6f1627192160766a9c55c=1722159155; HMACCOUNT=770873722DFFDFD2; Hm_lpvt_b1b4b9ea61b6f1627192160766a9c55c='.$time,
  20. 'Accesstoken' => 'jkFXxgu9TcpocIyCKmJ+tfpxe/45B9dbWMUXhdY7vLWkw4PNGtQkV0GzhDucU6n4hpUUKvcMtoMqfGfwdLCb8g=='
  21. ];
  22. $params = [
  23. 'complexname' => '成都翔威建筑工程有限公司',
  24. 'pg' => 0,
  25. 'pgsz' => 15,
  26. 'total' => 0
  27. ];
  28. $res = $client->request('GET', $url, [
  29. 'query' => $params,
  30. 'headers' => $header
  31. ]);
  32. dd($res);
  33. }
  34. }