|
...
|
...
|
@@ -314,20 +314,7 @@ class RankDataLogic extends BaseLogic |
|
|
|
public function getAiProjects($domain = null)
|
|
|
|
{
|
|
|
|
$file_path = public_path('ai_domains.txt');
|
|
|
|
$update_time = filemtime($file_path);
|
|
|
|
$data = file_get_contents($file_path);
|
|
|
|
if (time() - $update_time > 4 * 3600) {
|
|
|
|
$api_url = 'https://demosite5.globalso.com/api/domain';
|
|
|
|
try {
|
|
|
|
$data = HttpUtils::get($api_url, []);
|
|
|
|
if ($data) {
|
|
|
|
file_put_contents($file_path, $data);
|
|
|
|
}
|
|
|
|
} catch (\Exception | GuzzleException $e) {
|
|
|
|
errorLog('AI站点项目获取失败', [], $e);
|
|
|
|
file_put_contents($file_path, $data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$data = json_decode($data, true);
|
|
|
|
if ($domain !== null) {
|
|
|
|
$domain = parse_url($domain);
|
...
|
...
|
|