Skip to content

Commit 63be2a8

Browse files
committed
update url param
1 parent 059df5b commit 63be2a8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

laravel/app/Http/Repository/BusRepository.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,17 @@ public function getListV2($line, $refresh = false)
237237
}
238238
try {
239239
// 新版本直接调用接口
240-
$url = 'http://www.szjt.gov.cn/BusQu/APTSLine.aspx/GetData';
241-
$param = '{"num":"'.$line.'"}';
240+
$param = http_build_query(['LineName' => $line]);
241+
$url = 'http://jtj.suzhou.gov.cn/szinf/interfaceJtj/gjxlcx?'.$param;
242242
$header = [
243243
'content-type: Application/json',
244244
'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36',
245245
'Accept: application/json',
246-
'Host: www.szjt.gov.cn',
247-
'Origin: http://www.szjt.gov.cn',
246+
'Host: jtj.suzhou.gov.cn/',
247+
'Origin: http://jtj.suzhou.gov.cn/',
248+
'X-Requested-With: XMLHttpRequest',
248249
];
249-
$data = Http::getInstent()->post($url, $param, 4, $header);
250+
$data = Http::getInstent()->post($url, [], 4, $header);
250251

251252
if ($data['content']) {
252253
$res = json_decode($data['content'], true);

0 commit comments

Comments
 (0)