作者 lyh

GX生成白帽报表脚本

@@ -66,12 +66,17 @@ class GeoQuestionRes extends Command @@ -66,12 +66,17 @@ class GeoQuestionRes extends Command
66 echo '执行数据详情:'.$q_item.'/'.$p_item.PHP_EOL; 66 echo '执行数据详情:'.$q_item.'/'.$p_item.PHP_EOL;
67 $keywords = [];//命中的关键词 67 $keywords = [];//命中的关键词
68 $urls = [];//命中的网址 68 $urls = [];//命中的网址
  69 + try {
69 $result_data = $geoService->setWebSearchChatAction($q_item,$p_item); 70 $result_data = $geoService->setWebSearchChatAction($q_item,$p_item);
70 echo 'success:'.$result_data['code'].PHP_EOL; 71 echo 'success:'.$result_data['code'].PHP_EOL;
71 if(isset($result_data) && $result_data['code'] == 200){ 72 if(isset($result_data) && $result_data['code'] == 200){
72 $keywords = $this->getKeywords($keywordArr,$result_data['text'] ?? []); 73 $keywords = $this->getKeywords($keywordArr,$result_data['text'] ?? []);
73 $urls = $this->getUrl($urlArr,$result_data['annotations'] ?? []); 74 $urls = $this->getUrl($urlArr,$result_data['annotations'] ?? []);
74 } 75 }
  76 + }catch (\Exception $e){
  77 + echo $e->getMessage().PHP_EOL;
  78 + continue;
  79 + }
75 //保存一条结果记录 80 //保存一条结果记录
76 $data = [ 81 $data = [
77 'project_id'=>$info['project_id'], 82 'project_id'=>$info['project_id'],
@@ -33,11 +33,11 @@ class GeoPlatform extends Base @@ -33,11 +33,11 @@ class GeoPlatform extends Base
33 * @time :2025/7/3 11:18 33 * @time :2025/7/3 11:18
34 */ 34 */
35 public function getList(){ 35 public function getList(){
36 - $data = Cache::get('geo_platform');  
37 - if(empty($data)){ 36 +// $data = Cache::get('geo_platform');
  37 +// if(empty($data)){
38 $data = $this->list(['status'=>$this::STATUS_ON],'id',['name','en_name','icon','sort'],'desc'); 38 $data = $this->list(['status'=>$this::STATUS_ON],'id',['name','en_name','icon','sort'],'desc');
39 Cache::put('geo_platform',$data,'12 * 3600'); 39 Cache::put('geo_platform',$data,'12 * 3600');
40 - } 40 +// }
41 return $data; 41 return $data;
42 } 42 }
43 } 43 }