From 30427a9704f8d69f33b04c445e10eb84120f8fb5 Mon Sep 17 00:00:00 2001 From: net909 Date: Tue, 17 Sep 2024 10:11:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0CF=E4=BC=98=E9=80=89IP?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/OptimizeService.php | 16 ++++++++++------ app/view/optimizeip/opipset.html | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/lib/OptimizeService.php b/app/lib/OptimizeService.php index 72d5d03..fb792f2 100644 --- a/app/lib/OptimizeService.php +++ b/app/lib/OptimizeService.php @@ -28,7 +28,7 @@ class OptimizeService }elseif($api == 1){ $url = 'https://api.hostmonit.com/get_license?license='.$key; }else{ - $url = 'https://monitor.gacjie.cn/api/client/get_account_integral?license='.$key; + $url = 'https://www.182682.xyz/api/cf2dns/get_license?license='.$key; } $response = get_curl($url); $arr = json_decode($response, true); @@ -43,20 +43,24 @@ class OptimizeService public function get_ip_address($cdn_type = 1, $ip_type = 'v4'){ $api = config_get('optimize_ip_api', 0); - if($api == 1){ + if($api == 2){ $url = 'https://api.345673.xyz/get_data'; }elseif($api == 1){ $url = 'https://api.hostmonit.com/get_optimization_ip'; }else{ - $url = 'https://monitor.gacjie.cn/api/client/get_ip_address'; + $url = 'https://www.182682.xyz/api/cf2dns/'; + if($cdn_type == 1){ + $url .= 'get_cloudflare_ip'; + }elseif($cdn_type == 2){ + $url .= 'get_cloudfront_ip'; + }elseif($cdn_type == 3){ + $url .= 'get_gcore_ip'; + } } $params = [ 'key' => config_get('optimize_ip_key', 'o1zrmHAF'), 'type' => $ip_type, ]; - if($api == 0){ - $params['cdn_server'] = $cdn_type; - } $response = get_curl($url, json_encode($params), 0, 0, 0, 0, 0, ['Content-Type: application/json; charset=UTF-8']); $arr = json_decode($response, true); if(isset($arr['code']) && $arr['code'] == 200){ diff --git a/app/view/optimizeip/opipset.html b/app/view/optimizeip/opipset.html index 8eb5d93..8af3748 100644 --- a/app/view/optimizeip/opipset.html +++ b/app/view/optimizeip/opipset.html @@ -13,7 +13,7 @@

使用说明

-

  • 数据接口:GacJieMonitor 数据接口支持CloudFlare、CloudFront、Gcore;HostMonit 只支持CloudFlare;345673.xyz 只支持CloudFlare。
  • +

  • 数据接口:182682.xyz 数据接口支持CloudFlare、CloudFront、Gcore;HostMonit 只支持CloudFlare;345673.xyz 只支持CloudFlare。
  • 接口密钥:默认o1zrmHAF为免费KEY可永久免费使用。
  • 计划任务:将以下命令添加到计划任务,周期设置为15分钟以上
  • cd {:app()->getRootPath()} && php think opiptask

    @@ -27,7 +27,7 @@
    -
    +