作者 赵彬吉

update

@@ -531,24 +531,12 @@ class OptimizationReportController extends BaseController @@ -531,24 +531,12 @@ class OptimizationReportController extends BaseController
531 */ 531 */
532 public function getAiProjects($domain = null) 532 public function getAiProjects($domain = null)
533 { 533 {
534 - $key = 'ai_projects_list';  
535 - $data = Cache::get($key);  
536 - if (!$data) {  
537 - $api_url = 'https://demosite5.globalso.com/api/domain';  
538 - try {  
539 - $data = HttpUtils::get($api_url, []);  
540 - if ($data) {  
541 - $data = Arr::s2a($data);  
542 - Cache::put($key, $data, 4 * 3600);  
543 - }  
544 - } catch (\Exception | GuzzleException $e) {  
545 - errorLog('AI站点项目获取失败', [], $e);  
546 - return false;  
547 - }  
548 - } 534 + $file_path = public_path('ai_domains.txt');
  535 + $data = file_get_contents($file_path);
  536 + $data = json_decode($data, true);
549 if ($domain !== null) { 537 if ($domain !== null) {
550 $domain = parse_url($domain); 538 $domain = parse_url($domain);
551 - $data = collect($data['data'])->where('bind_domain', $domain['host'] ?? $domain['path'])->first(); 539 + $data = collect($data)->where('bind_domain', $domain['host'] ?? $domain['path'])->first();
552 return $data ?: []; 540 return $data ?: [];
553 } 541 }
554 return $data; 542 return $data;