作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate

... ... @@ -307,13 +307,11 @@ class DomainInfoLogic extends BaseLogic
//主站生成证书
EditDomainBt::dispatch($this->param['id']);
// $this->setDomainSsl($server_info['init_domain'],$info['domain'],$this->param['extend_config'] ?? [],$this->param['other_domain'] ?? [],$this->param['is_https'] ?? 0);
//amp站生成证书
if($data['amp_status']){
EditAmpDomainBt::dispatch($this->param['id']);
// $this->setAmpDomainSsl($server_info['init_domain'],$info['domain']);
}
return $this->success();
}
... ...
... ... @@ -77,9 +77,8 @@ class RankDataLogic extends BaseLogic
'keyword_num' => $project['deploy_build']['keyword_num'],
'compliance_day' => $project['finish_remain_day'] ?? 0,
'remain_day' => $project['deploy_build']['service_duration'] - ($project['finish_remain_day'] ?? 0),
'g_top_plan' => $project['g_top_plan'] ?? [],
'g_top_plan' => $project['deploy_optimize']['g_top_plan'] ?? [],
];
//小语种列表
$quanqiusou_api = new QuanqiusouApi();
$lang_data = $quanqiusou_api->getLangRankData($api_no);
... ...
... ... @@ -38,7 +38,6 @@ class EditCustomDomainBt implements ShouldQueue
*/
public function handle()
{
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书---开始', true) . PHP_EOL, FILE_APPEND);
//获取域名数据
$domain_model = new CountryCustom();
$domain_info = $domain_model->read(['id' => $this->domain_id]);
... ... @@ -68,7 +67,6 @@ class EditCustomDomainBt implements ShouldQueue
'other_domain' => [],
'is_https' => 1
];
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书--参数:'.json_encode($api_param), true) . PHP_EOL, FILE_APPEND);
} else {
$api_url = 'http://' . $server_info['init_domain'] . '/api/applySsl';
$api_param = [
... ... @@ -77,11 +75,9 @@ class EditCustomDomainBt implements ShouldQueue
'other_domain' => [],
'is_https' => 1
];
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书--参数:'.json_encode($api_param), true) . PHP_EOL, FILE_APPEND);
}
try {
$rs = HttpUtils::get($api_url, $api_param);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('请求接口返回数据:'.$rs, true) . PHP_EOL, FILE_APPEND);
$rs = json_decode($rs, true);
if (isset($rs['status']) && $rs['status'] == 200) {
$this->output($domain_info['custom_domain'] . ':站点编辑成功');
... ... @@ -89,7 +85,6 @@ class EditCustomDomainBt implements ShouldQueue
$this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . ($rs['message'] ?? ''));
}
} catch (\Exception | GuzzleException $e) {
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('错误情况打印:'.$rs, true) . PHP_EOL, FILE_APPEND);
$this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . $e->getMessage());
}
... ...
... ... @@ -9,6 +9,7 @@ use App\Models\Devops\ServerConfig;
use App\Models\Optimize\Process;
use App\Services\Facades\Upload;
use Illuminate\Support\Facades\Cache;
use App\Models\Domain\DomainInfo as DomainInfoModel;
class Project extends Base
{
... ... @@ -354,19 +355,23 @@ class Project extends Base
$project_id = DeployBuild::where('test_domain', 'https://' . $domain . '/')->value('project_id');
//是否正式域名
if (!$project_id) {
//是否小语种域名或amp站域名
$domainPrefix = explode(".",$domain);
if (!empty($domainPrefix)){
if($domainPrefix[0] == 'm'){
$domain = "www.".$domainPrefix[1].".".$domainPrefix[2];
}else{
$isLang = Translate::getTls($domainPrefix[0]);
if ($isLang) {
$domainModel = new DomainInfoModel();
$project_id = $domainModel->formatQuery(['domain'=>$domain,'status'=>1])->value('project_id');
if (empty($project_id)) {
//是否小语种域名或amp站域名
$domainPrefix = explode(".",$domain);
if (!empty($domainPrefix)){
if($domainPrefix[0] == 'm'){
$domain = "www.".$domainPrefix[1].".".$domainPrefix[2];
}else{
$isLang = Translate::getTls($domainPrefix[0]);
if ($isLang) {
$domain = "www.".$domainPrefix[1].".".$domainPrefix[2];
}
}
}
$project_id = $domainModel->formatQuery(['domain'=>$domain,'status'=>1])->value('project_id');
}
$project_id = \App\Models\Domain\DomainInfo::where('domain', $domain)->value('project_id');
}
$project = self::find($project_id ?: 0);
if($project){
... ...