123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace App\Http\Controllers;
- use GuzzleHttp\Client;
- use Illuminate\Foundation\Bus\DispatchesJobs;
- use Illuminate\Routing\Controller as BaseController;
- use Illuminate\Foundation\Validation\ValidatesRequests;
- use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
- class SourceController extends BaseController
- {
- use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
- public function getSource()
- {
- $client = new Client();
- $time = time();
- $url = 'https://jzsc.mohurd.gov.cn/APi/webApi/dataservice/query/comp/list';
- $header = [
- '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',
- 'Referer' => 'https://jzsc.mohurd.gov.cn/data/company',
- 'Cookie' => 'Hm_lvt_b1b4b9ea61b6f1627192160766a9c55c=1722159155; HMACCOUNT=770873722DFFDFD2; Hm_lpvt_b1b4b9ea61b6f1627192160766a9c55c='.$time,
- 'Accesstoken' => 'jkFXxgu9TcpocIyCKmJ+tfpxe/45B9dbWMUXhdY7vLWkw4PNGtQkV0GzhDucU6n4hpUUKvcMtoMqfGfwdLCb8g=='
- ];
- $params = [
- 'complexname' => '成都翔威建筑工程有限公司',
- 'pg' => 0,
- 'pgsz' => 15,
- 'total' => 0
- ];
- $res = $client->request('GET', $url, [
- 'query' => $params,
- 'headers' => $header
- ]);
- dd($res);
- }
- }
|