正在显示
1 个修改的文件
包含
19 行增加
和
12 行删除
| @@ -463,29 +463,36 @@ public function deleteDirectory($path) | @@ -463,29 +463,36 @@ public function deleteDirectory($path) | ||
| 463 | */ | 463 | */ | 
| 464 | public function transmit($request, $type = self::TYPEVISIT, $traffic = self::TRAFFICZERO) | 464 | public function transmit($request, $type = self::TYPEVISIT, $traffic = self::TRAFFICZERO) | 
| 465 | { | 465 | { | 
| 466 | - if ($request->getClientIp() == "127.0.0.1") { | ||
| 467 | - $this->response(); | 466 | + $data = $request->all(); | 
| 467 | + if (empty($data)) { | ||
| 468 | + $this->success(); | ||
| 468 | } | 469 | } | 
| 470 | + | ||
| 471 | + if($type == self::TYPEINQUIRY){ | ||
| 472 | + //询盘 | ||
| 473 | + $ip = $data['submit_ip'] ?? $request->getClientIp(); | ||
| 474 | + $referrer_url = $data['refer'] ?? $request->header('Referer'); | ||
| 475 | + }else{ | ||
| 476 | + //访问 | ||
| 477 | + $ip = $data['ip'] ?? $request->getClientIp(); | ||
| 478 | + $referrer_url = $data['referrer_url'] ?? $request->header('Referer'); | ||
| 479 | + } | ||
| 480 | + | ||
| 469 | //判断是否是爬虫 | 481 | //判断是否是爬虫 | 
| 470 | $isReptile = $this->isReptile($request); | 482 | $isReptile = $this->isReptile($request); | 
| 471 | if ($isReptile) { | 483 | if ($isReptile) { | 
| 472 | - $this->response(); | 484 | + $this->success(); | 
| 473 | } | 485 | } | 
| 474 | 486 | ||
| 475 | - $data = $request->all(); | ||
| 476 | - if (empty($data)) { | ||
| 477 | - $this->response(); | ||
| 478 | - } | ||
| 479 | - $data["device_port"] = $this->userAgentHandle($request->userAgent(), $data["device_port"] ?? self::DEVICE_PORT_ONE); | 487 | + $data["device_port"] = $this->userAgentHandle($request->header('User-Agent'), $data["device_port"] ?? self::DEVICE_PORT_ONE); | 
| 480 | $req["data"] = $data; | 488 | $req["data"] = $data; | 
| 481 | - $referrer_url = $data["referrer_url"] ?? $request->header('Referer'); | ||
| 482 | if ($type == self::TYPEVISIT) { | 489 | if ($type == self::TYPEVISIT) { | 
| 483 | $referrer_url = $this->visitInfoHandle($referrer_url); | 490 | $referrer_url = $this->visitInfoHandle($referrer_url); | 
| 484 | } | 491 | } | 
| 485 | $req["referer"] = $referrer_url; | 492 | $req["referer"] = $referrer_url; | 
| 486 | $req["domain"] = $request->getHost(); | 493 | $req["domain"] = $request->getHost(); | 
| 487 | - $req["ip"] = $request->getClientIp(); | ||
| 488 | - $req["user_agent"] = $request->userAgent(); | 494 | + $req["ip"] = $ip; | 
| 495 | + $req["user_agent"] = $request->header('User-Agent'); | ||
| 489 | $req["files"] = isset($data["files"]) ? $data["files"] : null; | 496 | $req["files"] = isset($data["files"]) ? $data["files"] : null; | 
| 490 | $req["type"] = $type; | 497 | $req["type"] = $type; | 
| 491 | $req["traffic"] = $traffic; | 498 | $req["traffic"] = $traffic; | 
| @@ -688,7 +695,7 @@ public function inquiryOtherInfo(Request $request) | @@ -688,7 +695,7 @@ public function inquiryOtherInfo(Request $request) | ||
| 688 | */ | 695 | */ | 
| 689 | public function inquiryQd(Request $request) | 696 | public function inquiryQd(Request $request) | 
| 690 | { | 697 | { | 
| 691 | - return $this->transmit($request, self::TYPEINQUIRY); | 698 | + return $this->transmit($request, self::TYPEINQUIRY,self::TRAFFICONE); | 
| 692 | } | 699 | } | 
| 693 | 700 | ||
| 694 | /** | 701 | /** | 
- 
请 注册 或 登录 后发表评论