作者 lyh

gx

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