Browse Source

update

tags/2.2.1
flucout 12 months ago
parent
commit
4c76ec2056
  1. 9
      app/controller/Api.php
  2. 14
      app/lib/Plugins.php
  3. 3
      route/app.php

9
app/controller/Api.php

@ -387,6 +387,7 @@ class Api extends BaseController
return json(['page'=>"<div><span class='Pcurrent'>1</span><span class='Pnumber'>1/0</span><span class='Pline'>从1-1000条</span><span class='Pcount'>共计0条数据</span></div>", 'data'=>[]]); return json(['page'=>"<div><span class='Pcurrent'>1</span><span class='Pnumber'>1/0</span><span class='Pline'>从1-1000条</span><span class='Pcount'>共计0条数据</span></div>", 'data'=>[]]);
} }
//获取所有蜘蛛IP列表
public function btwaf_getspiders(){ public function btwaf_getspiders(){
try{ try{
$result = Plugins::btwaf_getspiders(); $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(){ private function checklist(){
if(config_get('whitelist') == 1){ if(config_get('whitelist') == 1){

14
app/lib/Plugins.php

@ -151,4 +151,18 @@ class Plugins
return $result; 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;
}
} }

3
route/app.php

@ -26,6 +26,7 @@ Route::group('authorization', function () {
Route::post('/info', 'api/authorization_info'); Route::post('/info', 'api/authorization_info');
Route::post('/info_v2', 'api/authorization_info'); Route::post('/info_v2', 'api/authorization_info');
Route::post('/update_license', 'api/update_license'); 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::post('/is_obtained_btw_trial', 'api/is_obtained_btw_trial');
Route::miss('api/return_error'); Route::miss('api/return_error');
}); });
@ -109,11 +110,13 @@ Route::group('api', function () {
Route::get('/wpanel/get_beta_logs', 'api/get_beta_logs'); 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_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::any('/bt_waf/getSpiders', 'api/btwaf_getspiders');
Route::post('/bt_waf/addSpider', 'api/return_empty'); Route::post('/bt_waf/addSpider', 'api/return_empty');
Route::post('/bt_waf/getVulScanInfoList', 'api/return_empty'); Route::post('/bt_waf/getVulScanInfoList', 'api/return_empty');
Route::post('/bt_waf/reportInterceptFail', 'api/return_empty'); Route::post('/bt_waf/reportInterceptFail', 'api/return_empty');
Route::any('/panel/get_spider', 'api/get_spider');
Route::miss('api/return_error'); Route::miss('api/return_error');
}); });

Loading…
Cancel
Save