From 4c76ec2056a6e0d8af0d99e41d80463443b5a07a Mon Sep 17 00:00:00 2001 From: flucout Date: Thu, 7 Dec 2023 14:45:15 +0800 Subject: [PATCH] update --- app/controller/Api.php | 9 +++++++++ app/lib/Plugins.php | 14 ++++++++++++++ route/app.php | 3 +++ 3 files changed, 26 insertions(+) diff --git a/app/controller/Api.php b/app/controller/Api.php index f06ae75..96cc88e 100644 --- a/app/controller/Api.php +++ b/app/controller/Api.php @@ -387,6 +387,7 @@ class Api extends BaseController return json(['page'=>"
11/0从1-1000条共计0条数据
", 'data'=>[]]); } + //获取所有蜘蛛IP列表 public function btwaf_getspiders(){ try{ $result = Plugins::btwaf_getspiders(); @@ -396,6 +397,14 @@ class Api extends BaseController } } + //分类获取蜘蛛IP列表 + public function get_spider(){ + $type = input('get.spider/d'); + if(!$type) return json([]); + $result = Plugins::get_spider($type); + return json($result); + } + //检查黑白名单 private function checklist(){ if(config_get('whitelist') == 1){ diff --git a/app/lib/Plugins.php b/app/lib/Plugins.php index 201621d..ede17f7 100644 --- a/app/lib/Plugins.php +++ b/app/lib/Plugins.php @@ -151,4 +151,18 @@ class Plugins return $result; } + //分类获取蜘蛛IP列表 + public static function get_spider($type){ + $result = cache('get_spider_'.$type); + if($result){ + return $result; + } + $url = 'https://www.bt.cn/api/panel/get_spider?spider='.$type; + $data = get_curl($url); + $result = json_decode($data, true); + if(!$result) return []; + cache('get_spider_'.$type, $result, 3600 * 24); + return $result; + } + } \ No newline at end of file diff --git a/route/app.php b/route/app.php index 2f67d5b..d061bea 100644 --- a/route/app.php +++ b/route/app.php @@ -26,6 +26,7 @@ Route::group('authorization', function () { Route::post('/info', 'api/authorization_info'); Route::post('/info_v2', 'api/authorization_info'); Route::post('/update_license', 'api/update_license'); + Route::post('/get_unactivated_licenses', 'api/get_ssl_list'); Route::post('/is_obtained_btw_trial', 'api/is_obtained_btw_trial'); Route::miss('api/return_error'); }); @@ -109,11 +110,13 @@ Route::group('api', function () { Route::get('/wpanel/get_beta_logs', 'api/get_beta_logs'); Route::post('/v2/common_v1_authorization/get_pricing', 'api/return_error2'); + Route::post('/v2/common_v2_authorization/get_pricing', 'api/return_error2'); Route::any('/bt_waf/getSpiders', 'api/btwaf_getspiders'); Route::post('/bt_waf/addSpider', 'api/return_empty'); Route::post('/bt_waf/getVulScanInfoList', 'api/return_empty'); Route::post('/bt_waf/reportInterceptFail', 'api/return_empty'); + Route::any('/panel/get_spider', 'api/get_spider'); Route::miss('api/return_error'); });