作者 lyh

gx

... ... @@ -100,7 +100,7 @@ class HtmlCollect extends Command
//关闭数据库
DB::disconnect('custom_mysql');
sleep(2);
return true;
}
//获取任务
... ... @@ -155,6 +155,7 @@ class HtmlCollect extends Command
if ($complete) {
$update_log->collect_status = UpdateLog::COLLECT_STATUS_MAIN;
$update_log->save();
return 0;
}
... ... @@ -223,11 +224,12 @@ class HtmlCollect extends Command
$scheme = $arr['scheme'] ?? '';
$host = $arr['host'] ?? '';
$path = $arr['path'] ?? '';
$query = $arr['query'] ?? '';
if (
(empty($host) || $host == $domain)
&& $path
&& (strpos($path, '.') !== false)
(strpos($host, '.globalso.') === false) &&
(strpos($host, '.goodao.') === false) &&
$path && (strpos($path, '.') !== false)
) {
$source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first();
... ... @@ -235,7 +237,7 @@ class HtmlCollect extends Command
return [
'download' => true,
'url' => $url,
'url_complete' => ($scheme ?: 'https') . '://' . ($host ?: $domain) . $path
'url_complete' => ($scheme ?: 'https') . '://' . ($host ?: $domain) . $path . ($query ? '?' . $query : '')
];
} else {
return [
... ...
... ... @@ -100,7 +100,7 @@ class HtmlLanguageCollect extends Command
//关闭数据库
DB::disconnect('custom_mysql');
sleep(2);
return true;
}
//获取任务
... ... @@ -155,6 +155,7 @@ class HtmlLanguageCollect extends Command
if ($complete) {
$update_log->collect_status = UpdateLog::COLLECT_STATUS_COM;
$update_log->save();
return 0;
}
... ... @@ -223,11 +224,12 @@ class HtmlLanguageCollect extends Command
$scheme = $arr['scheme'] ?? '';
$host = $arr['host'] ?? '';
$path = $arr['path'] ?? '';
$query = $arr['query'] ?? '';
if (
(empty($host) || $host == $domain)
&& $path
&& (strpos($path, '.') !== false)
(strpos($host, '.globalso.') === false) &&
(strpos($host, '.goodao.') === false) &&
$path && (strpos($path, '.') !== false)
) {
$source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first();
... ... @@ -235,7 +237,7 @@ class HtmlLanguageCollect extends Command
return [
'download' => true,
'url' => $url,
'url_complete' => ($scheme ?: 'https') . '://' . ($host ?: $domain) . $path
'url_complete' => ($scheme ?: 'https') . '://' . ($host ?: $domain) . $path . ($query ? '?' . $query : '')
];
} else {
return [
... ...
... ... @@ -76,7 +76,8 @@ class CosService
public static function uploadRemote($project_id,$image_type,$file_url,$key='')
{
if(!$key){
$ext = explode('.',$file_url);
$url_arr = parse_url($file_url);
$ext = explode('.',$url_arr['path']);
$filename = uniqid().rand(10000,99999).'.'.end($ext);
... ...