作者 刘锟

update

... ... @@ -154,11 +154,17 @@ public function uploadVerifyFile(Request $request)
{
$domain = $request->getHost();
$files = $request->allFiles();
$file_name = '';
foreach ($files as $file) {
$destinationPath = public_path($domain);
$file->move($destinationPath, $file->getClientOriginalName());
$filePath = $destinationPath . '/' . $file->getClientOriginalName();
@file_put_contents(storage_path('logs/upload_file.log'), date('Y-m-d H:i:s') . " " . $filePath . PHP_EOL, FILE_APPEND);
$file_name = $file->getClientOriginalName();
}
if ($file_name) {
$transmitUrl = env("TRANSMIT_URL");
$this->httpPost($transmitUrl . "api/selfSiteVerify/", json_encode(['file_name' => $file_name, 'type' => 1]));
}
return $this->success();
}
... ... @@ -183,11 +189,17 @@ public function uploadAmpVerifyFile(Request $request)
$amp_domain = implode('.', $host_array);
$files = $request->allFiles();
$file_name = '';
foreach ($files as $file) {
$destinationPath = public_path($amp_domain);
$file->move($destinationPath, $file->getClientOriginalName());
$filePath = $destinationPath . '/' . $file->getClientOriginalName();
@file_put_contents(storage_path('logs/upload_file.log'), date('Y-m-d H:i:s') . " " . $filePath . PHP_EOL, FILE_APPEND);
$file_name = $file->getClientOriginalName();
}
if ($file_name) {
$transmitUrl = env("TRANSMIT_URL");
$this->httpPost($transmitUrl . "api/selfSiteVerify/", json_encode(['file_name' => $file_name, 'type' => 2]));
}
return $this->success();
}
... ... @@ -354,7 +366,7 @@ public function transmit($request, $type = self::TYPEVISIT, $traffic = self::TRA
$data["device_port"] = $this->userAgentHandle($request->userAgent(), $data["device_port"] ?? self::DEVICE_PORT_ONE);
$req["data"] = $data;
$referrer_url = $data["referrer_url"] ?? $request->header('Referer');
if($type == self::TYPEVISIT){
if ($type == self::TYPEVISIT) {
$referrer_url = $this->visitInfoHandle($referrer_url);
}
$req["referer"] = $referrer_url;
... ...