正在显示
1 个修改的文件
包含
4 行增加
和
16 行删除
| @@ -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; |
-
请 注册 或 登录 后发表评论