作者 刘锟

update

... ... @@ -313,6 +313,8 @@ class DomainInfoLogic extends BaseLogic
'amp_type' => $this->param['amp_type'] ?? 0,
'amp_private_key' => $this->param['amp_key'] ?? '',
'amp_private_cert' => $this->param['amp_cert'] ?? '',
'not_allow_country'=>json_encode($this->param['not_allow_country'] ?? []),
'not_allow_ip'=>json_encode($this->param['not_allow_ip'] ?? []),
];
$this->model->edit($data,['id'=>$this->param['id']]);
//主站生成证书
... ...
... ... @@ -66,6 +66,8 @@ class EditAmpDomainBt implements ShouldQueue
$api_url_amp = 'http://' . $server_info['domain'] . '/api/createSiteAmp';
$api_param_amp = [
'domain' => $domain_info['domain'],
'not_allow_country' => $domain_info['not_allow_country'],
'not_allow_ip' => $domain_info['not_allow_ip']
];
if ($domain_info['amp_type'] == 2) {
$api_param_amp['private_key'] = $domain_info['amp_private_key'];
... ...
... ... @@ -72,7 +72,9 @@ class EditDomainBt implements ShouldQueue
'cert' => $domain_info['private_cert'],
'rewrite' => $domain_info['extend_config'],
'other_domain' => $domain_info['other_domain'],
'is_https' => $domain_info['is_https']
'is_https' => $domain_info['is_https'],
'not_allow_country' => $domain_info['not_allow_country'],
'not_allow_ip' => $domain_info['not_allow_ip']
];
} else {
$api_url = 'http://' . $server_info['domain'] . '/api/applySsl';
... ... @@ -80,7 +82,9 @@ class EditDomainBt implements ShouldQueue
'domain' => $domain_info['domain'],
'rewrite' => $domain_info['extend_config'],
'other_domain' => $domain_info['other_domain'],
'is_https' => $domain_info['is_https']
'is_https' => $domain_info['is_https'],
'not_allow_country' => $domain_info['not_allow_country'],
'not_allow_ip' => $domain_info['not_allow_ip']
];
}
... ...
... ... @@ -107,4 +107,30 @@ class DomainInfo extends Base
$value = Arr::s2a($value);
return $value;
}
/**
* 禁止访问国家
* @param $value
* @return array|mixed
* @author Akun
* @date 2024/07/01 17:05
*/
public function getNotAllowCountryAttribute($value)
{
$value = Arr::s2a($value);
return $value;
}
/**
* 禁止访问ip
* @param $value
* @return array|mixed
* @author Akun
* @date 2024/07/01 17:05
*/
public function getNotAllowIpAttribute($value)
{
$value = Arr::s2a($value);
return $value;
}
}
... ...