mirror of
https://github.com/netcccyun/dnsmgr.git
synced 2026-02-21 07:17:22 +08:00
增加证书API接口
This commit is contained in:
parent
cf36b4bd51
commit
fb8fe3526b
@ -244,6 +244,17 @@ class Cert extends BaseController
|
||||
return json(['total' => $total, 'rows' => $list]);
|
||||
}
|
||||
|
||||
public function order_info()
|
||||
{
|
||||
if (!checkPermission(2)) return $this->alert('error', '无权限');
|
||||
$id = input('post.id/d');
|
||||
$row = Db::name('cert_order')->where('id', $id)->find();
|
||||
if (!$row) return json(['code' => -1, 'msg' => '证书订单不存在']);
|
||||
$pfx = CertHelper::getPfx($row['fullchain'], $row['privatekey']);
|
||||
$row['pfx'] = base64_encode($pfx);
|
||||
return json(['code' => 0, 'data' => ['id' => $row['id'], 'crt' => $row['fullchain'], 'key' => $row['privatekey'], 'pfx' => $row['pfx'], 'issuetime' => $row['issuetime'], 'expiretime' => $row['expiretime'], 'domains' => Db::name('cert_domain')->where('oid', $row['id'])->order('sort','ASC')->column('domain')]]);
|
||||
}
|
||||
|
||||
public function order_op()
|
||||
{
|
||||
if (!checkPermission(2)) return $this->alert('error', '无权限');
|
||||
|
||||
@ -136,6 +136,8 @@ Route::group('api', function () {
|
||||
Route::post('/record/remark/:id', 'domain/record_remark');
|
||||
Route::post('/record/batch/:id', 'domain/record_batch');
|
||||
|
||||
Route::post('/cert/order', 'cert/order_info');
|
||||
|
||||
})->middleware(AuthApi::class);
|
||||
|
||||
Route::miss(function() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user