mirror of
https://github.com/certd/certd.git
synced 2026-05-16 21:27:34 +08:00
feat: 域名验证方法支持CNAME间接方式,此方式支持所有域名注册商,且无需提供Access授权,但是需要手动添加cname解析
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { ALL, Body, Controller, Inject, Post, Provide } from '@midwayjs/core';
|
||||
import { BaseController, Constants } from '@certd/lib-server';
|
||||
import { CnameRecordService } from '../service/cname-record-service.js';
|
||||
import { CnameProviderService } from '../../sys/cname/service/cname-provider-service.js';
|
||||
|
||||
/**
|
||||
* 授权
|
||||
*/
|
||||
@Provide()
|
||||
@Controller('/api/cname/provider')
|
||||
export class CnameProviderController extends BaseController {
|
||||
@Inject()
|
||||
service: CnameRecordService;
|
||||
@Inject()
|
||||
providerService: CnameProviderService;
|
||||
|
||||
getService(): CnameRecordService {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
@Post('/list', { summary: Constants.per.authOnly })
|
||||
async list(@Body(ALL) body: any) {
|
||||
body.userId = this.ctx.user.id;
|
||||
const res = await this.providerService.find({});
|
||||
return this.ok(res);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user