|
...
|
...
|
@@ -3,6 +3,7 @@ |
|
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
|
|
|
|
use App\Exceptions\InquiryFilterException;
|
|
|
|
use App\Models\Domain\DomainInfo;
|
|
|
|
use App\Models\Mail\Mail;
|
|
|
|
use App\Models\Project\DeployBuild;
|
|
|
|
use App\Models\Project\Project;
|
|
...
|
...
|
@@ -69,7 +70,7 @@ class SelfSiteController extends BaseController |
|
|
|
$cos = new CosService();
|
|
|
|
$fileName = uniqid() . rand(10000, 99999) . '.' . $file['ext'];
|
|
|
|
$file_data = base64_decode($file['data']);
|
|
|
|
$path = $cos->uploadFile($file_data, '/inquiry/' . date('Ymd'), $fileName,true);
|
|
|
|
$path = $cos->uploadFile($file_data, '/inquiry/' . date('Ymd'), $fileName, true);
|
|
|
|
$data[$key] = [
|
|
|
|
'path' => $path,
|
|
|
|
'original_name' => $file['name'],
|
|
...
|
...
|
@@ -191,4 +192,50 @@ class SelfSiteController extends BaseController |
|
|
|
|
|
|
|
return $this->success([]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 自建站获取通配符证书接口
|
|
|
|
* @param Request $request
|
|
|
|
* @return false|string
|
|
|
|
* @author Akun
|
|
|
|
* @date 2025/09/02 16:55
|
|
|
|
*/
|
|
|
|
public function selfSiteSsl(Request $request)
|
|
|
|
{
|
|
|
|
$token = $request->header('token');//token
|
|
|
|
$pid = $request->header('pid');//项目id
|
|
|
|
|
|
|
|
if (empty($token) || empty($pid)) {
|
|
|
|
return $this->error('token无效', 401);
|
|
|
|
}
|
|
|
|
|
|
|
|
//判断token是否有效
|
|
|
|
$project_model = new Project();
|
|
|
|
$project_info = $project_model->read(['id' => $pid, 'site_token' => $token]);
|
|
|
|
if (!$project_info) {
|
|
|
|
return $this->error('token无效', 401);
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取域名信息
|
|
|
|
$domain_model = new DomainInfo();
|
|
|
|
$domain_info = $domain_model->read(['project_id' => $pid]);
|
|
|
|
if (!$domain_info) {
|
|
|
|
return $this->error('获取域名失败', 401);
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取通配符证书
|
|
|
|
$top_domain = getTopDomain($domain_info['domain']);
|
|
|
|
$ssl_re = httpGetSsl($top_domain);
|
|
|
|
$return = [
|
|
|
|
'ssl_key' => '',
|
|
|
|
'ssl_cert' => ''
|
|
|
|
];
|
|
|
|
if (isset($ssl_re['status']) && $ssl_re['status'] == 2) {
|
|
|
|
//获取成功
|
|
|
|
$return['ssl_key'] = $ssl_re['ssl_key'];
|
|
|
|
$return['ssl_cert'] = $ssl_re['ssl_cert'];
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->success($return);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|