mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
perf: 增加域名管理 子域名检查提醒
This commit is contained in:
@@ -3,6 +3,7 @@ import { Constants, CrudController } from '@certd/lib-server';
|
||||
import { DomainService } from "../../../modules/cert/service/domain-service.js";
|
||||
import { checkPlus } from '@certd/plus-core';
|
||||
import { ApiTags } from '@midwayjs/swagger';
|
||||
import { parseDomainByPsl } from '@certd/plugin-lib';
|
||||
|
||||
/**
|
||||
* 授权
|
||||
@@ -187,4 +188,12 @@ export class DomainController extends CrudController<DomainService> {
|
||||
return this.ok(setting);
|
||||
}
|
||||
|
||||
@Post('/isSubdomain', { description: Constants.per.authOnly, summary: "判断是否为子域名" })
|
||||
async isSubdomain(@Body(ALL) body: any) {
|
||||
const { domain } = body;
|
||||
const parsed = parseDomainByPsl(domain)
|
||||
const mainDomain = parsed.domain || ''
|
||||
return this.ok(mainDomain !== domain);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user