|
...
|
...
|
@@ -242,6 +242,11 @@ class OptimizeController extends BaseController |
|
|
|
'robots.required' => 'robots不能为空',
|
|
|
|
'project_id.required' => 'project_id不能为空',
|
|
|
|
]);
|
|
|
|
$projectModel = new Project();
|
|
|
|
$rs = $projectModel->edit(['robots'=>$this->param['robots']],['id'=>$this->param['project_id']]);
|
|
|
|
if($rs === false){
|
|
|
|
$this->response('执行错误,请联系开发人员',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
//TODO::通知C端
|
|
|
|
$projectLogic = new ProjectLogic();
|
|
|
|
$project = $projectLogic->getProjectInfo($this->param['project_id']);
|
|
...
|
...
|
@@ -249,16 +254,11 @@ class OptimizeController extends BaseController |
|
|
|
if(empty($domain)){
|
|
|
|
$domain = $project['deploy_build']['test_domain'];
|
|
|
|
}
|
|
|
|
$url = $domain.'/api/update_robots/?project_id='.$this->param['project_id'];
|
|
|
|
$res = http_get($url);
|
|
|
|
$url = $domain.'api/update_robots/?project_id='.$this->param['project_id'];
|
|
|
|
$res = curlGet($url);
|
|
|
|
if(empty($res) || $res['status'] != 200){
|
|
|
|
$this->response('生成robots失败,请联系开发人员',Code::SYSTEM_ERROR,['url'=>$url]);
|
|
|
|
}
|
|
|
|
$projectModel = new Project();
|
|
|
|
$rs = $projectModel->edit(['robots'=>$this->param['robots']],['id'=>$this->param['project_id']]);
|
|
|
|
if($rs === false){
|
|
|
|
$this->response('系统错误,请联系管理员',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
$this->response('success');
|
|
|
|
$this->response('success',Code::SUCCESS,['url'=>$domain.'robots.txt']);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|