master
skycaiji 2023-04-27 23:57:29 +08:00
parent c2d86c6604
commit ae8a4e554c
6 changed files with 20 additions and 8 deletions

View File

@ -1511,7 +1511,7 @@ class CpatternColl extends CpatternBase{
$ex='页面渲染失败:'.$ex->getMessage().' 请检查<a href="'.url('setting/page_render').'" target="_blank">渲染设置</a>'; $ex='页面渲染失败:'.$ex->getMessage().' 请检查<a href="'.url('setting/page_render').'" target="_blank">渲染设置</a>';
if(!is_empty(g_sc_c('proxy','open'))){ if(!is_empty(g_sc_c('proxy','open'))){
$ex.=' <a href="'.url('setting/proxy').'" target="_blank">代理设置</a>'; $ex.=' <a href="'.(is_empty(g_sc('c_original','proxy','open'))?url('admin/task/save&id='.$this->collector['task_id']):url('setting/proxy')).'" target="_blank">代理设置</a>';
} }
$this->echo_error($ex); $this->echo_error($ex);
return null; return null;

View File

@ -10,7 +10,7 @@
*/ */
define('SKYCAIJI_VERSION', '2.5.3'); define('SKYCAIJI_VERSION', '2.5.4');
\think\Loader::addNamespace('plugin', realpath(SKYCAIJI_PATH.'plugin')); \think\Loader::addNamespace('plugin', realpath(SKYCAIJI_PATH.'plugin'));
\think\Loader::addNamespace('util',realpath(APP_PATH.'extend/util')); \think\Loader::addNamespace('util',realpath(APP_PATH.'extend/util'));

View File

@ -567,7 +567,7 @@ class ChromeSocket{
} }
public function getTabs(){ public function getTabs(){
$data=get_html($this->addressUrl.'/json'); $data=$this->getHtml('/json');
$data=empty($data)?array():json_decode($data,true); $data=empty($data)?array():json_decode($data,true);
return $data; return $data;
} }
@ -605,20 +605,28 @@ class ChromeSocket{
$tabId=$data['result']['targetId']; $tabId=$data['result']['targetId'];
}else{ }else{
$tabData=get_html($this->addressUrl.'/json/new'); $tabData=$this->getHtml('/json/new');
$tabData=empty($tabData)?array():json_decode($tabData,true); $tabData=empty($tabData)?array():json_decode($tabData,true);
$tabId=$tabData['id']; $tabId=$tabData['id'];
} }
$tabId=$tabId?$tabId:''; $tabId=$tabId?$tabId:'';
$this->tabId=$tabId; $this->tabId=$tabId;
} }
public function getHtml($uri,$timeout=null){
$options=array('custom_request'=>'put');
if($timeout){
$options['timeout']=$timeout;
}
$data=get_html($this->addressUrl.$uri,null,$options);
return $data;
}
public function closeTab($id){ public function closeTab($id){
get_html($this->addressUrl.'/json/close/'.$id,null,array('timeout'=>3)); $this->getHtml('/json/close/'.$id,3);
} }
public function getVersion(){ public function getVersion(){
$data=get_html($this->addressUrl.'/json/version'); $data=$this->getHtml('/json/version');
$data=empty($data)?array():json_decode($data,true); $data=empty($data)?array():json_decode($data,true);
return $data; return $data;
} }

View File

@ -91,6 +91,10 @@ class Curl{
curl_setopt($ch, CURLOPT_RANGE, $options['range_size']); curl_setopt($ch, CURLOPT_RANGE, $options['range_size']);
} }
if($options['custom_request']){
curl_setopt ( $ch, CURLOPT_CUSTOMREQUEST, $options['custom_request']);
}
if($isPost){ if($isPost){
curl_setopt ( $ch, CURLOPT_POST, 1 ); curl_setopt ( $ch, CURLOPT_POST, 1 );

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long