作者 lyh

gx

@@ -105,6 +105,7 @@ if (!function_exists('http_get')) { @@ -105,6 +105,7 @@ if (!function_exists('http_get')) {
105 curl_setopt($ch1, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); 105 curl_setopt($ch1, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
106 $access_txt = curl_exec($ch1); 106 $access_txt = curl_exec($ch1);
107 curl_close($ch1); 107 curl_close($ch1);
  108 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($access_txt, true) . PHP_EOL, FILE_APPEND);
108 return json_decode($access_txt, true); 109 return json_decode($access_txt, true);
109 } 110 }
110 } 111 }
@@ -252,7 +252,7 @@ class OptimizeController extends BaseController @@ -252,7 +252,7 @@ class OptimizeController extends BaseController
252 $url = $domain.'api/update_robots/?project_id='.$this->param['project_id']; 252 $url = $domain.'api/update_robots/?project_id='.$this->param['project_id'];
253 $res = http_get($url); 253 $res = http_get($url);
254 if(empty($res) || $res['status'] != 200){ 254 if(empty($res) || $res['status'] != 200){
255 - $this->response('生成robots失败,请联系开发人员',Code::SYSTEM_ERROR,['url'=>$url,'res'=>json_encode($res)]); 255 + $this->response('生成robots失败,请联系开发人员',Code::SYSTEM_ERROR,['url'=>$url]);
256 } 256 }
257 $projectModel = new Project(); 257 $projectModel = new Project();
258 $rs = $projectModel->edit(['robots'=>$this->param['robots']],['id'=>$this->param['project_id']]); 258 $rs = $projectModel->edit(['robots'=>$this->param['robots']],['id'=>$this->param['project_id']]);