mirror of
https://github.com/certd/certd.git
synced 2026-04-15 05:00:52 +08:00
perf: 支持中文域名
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { CreateRecordOptions, DnsProviderContext, IDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
|
||||
import { PlusService } from '@certd/lib-server';
|
||||
import {CreateRecordOptions, DnsProviderContext, IDnsProvider, RemoveRecordOptions} from '@certd/plugin-cert';
|
||||
import {PlusService} from '@certd/lib-server';
|
||||
|
||||
export type CommonCnameProvider = {
|
||||
id: number;
|
||||
@@ -24,7 +24,13 @@ export class CommonDnsProvider implements IDnsProvider {
|
||||
this.plusService = opts.plusService;
|
||||
}
|
||||
|
||||
async onInstance() {}
|
||||
usePunyCode(): boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
async onInstance() {
|
||||
}
|
||||
|
||||
async createRecord(options: CreateRecordOptions) {
|
||||
if (!this.config.domain.endsWith(options.domain)) {
|
||||
throw new Error('cname服务域名不匹配');
|
||||
@@ -45,6 +51,7 @@ export class CommonDnsProvider implements IDnsProvider {
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
async removeRecord(options: RemoveRecordOptions<any>) {
|
||||
const res = await this.plusService.requestWithToken({
|
||||
url: '/activation/certd/cname/recordRemove',
|
||||
@@ -60,6 +67,7 @@ export class CommonDnsProvider implements IDnsProvider {
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
setCtx(ctx: DnsProviderContext): void {
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user