|
...
|
...
|
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Aside\Optimize; |
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Http\Controllers\Aside\BaseController;
|
|
|
|
use App\Http\Logic\Aside\Optimize\OptimizeLogic;
|
|
|
|
use App\Http\Logic\Aside\Project\ProjectLogic;
|
|
|
|
use App\Models\Ai\AiPrefix;
|
|
|
|
use App\Models\ASide\APublicModel;
|
|
|
|
use App\Models\Channel\Channel;
|
|
...
|
...
|
@@ -241,12 +242,23 @@ class OptimizeController extends BaseController |
|
|
|
'robots.required' => 'robots不能为空',
|
|
|
|
'project_id.required' => 'project_id不能为空',
|
|
|
|
]);
|
|
|
|
//TODO::通知C端
|
|
|
|
$projectLogic = new ProjectLogic();
|
|
|
|
$project = $projectLogic->getProjectInfo($this->param['project_id']);
|
|
|
|
$domain = !empty($project['deploy_optimize']['domain']) ? ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : '';
|
|
|
|
if(!empty($domain)){
|
|
|
|
$domain = $project['deploy_build']['test_domain'];
|
|
|
|
}
|
|
|
|
$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);
|
|
|
|
}
|
|
|
|
$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端
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|