diff --git a/packages/ui/certd-client/src/views/certd/access/access-selector/index.vue b/packages/ui/certd-client/src/views/certd/access/access-selector/index.vue index e50653f19..0fabb3a4c 100644 --- a/packages/ui/certd-client/src/views/certd/access/access-selector/index.vue +++ b/packages/ui/certd-client/src/views/certd/access/access-selector/index.vue @@ -78,10 +78,10 @@ export default defineComponent({ async function emitValue(value) { const userId = userStore.userInfo.id; const isEnterprice = projectStore.isEnterprise; - if (pipeline.value) { + if (pipeline?.value) { if (isEnterprice) { const projectId = projectStore.currentProjectId; - if (pipeline.value.projectId !== projectId) { + if (pipeline?.value?.projectId !== projectId) { message.error(`对不起,您不能修改其他项目流水线的授权`); return; } diff --git a/packages/ui/certd-client/src/views/certd/addon/addon-selector/index.vue b/packages/ui/certd-client/src/views/certd/addon/addon-selector/index.vue index 5bbc157d7..c14dddbad 100644 --- a/packages/ui/certd-client/src/views/certd/addon/addon-selector/index.vue +++ b/packages/ui/certd-client/src/views/certd/addon/addon-selector/index.vue @@ -136,7 +136,7 @@ async function emitValue(value: any) { const isEnterprice = projectStore.isEnterprise; if (isEnterprice) { const projectId = projectStore.currentProjectId; - if (pipeline.value.projectId !== projectId) { + if (pipeline?.value?.projectId !== projectId) { message.error(`对不起,您不能修改其他项目流水线的${props.addonType}设置`); return; } diff --git a/packages/ui/certd-client/src/views/certd/notification/notification-selector/index.vue b/packages/ui/certd-client/src/views/certd/notification/notification-selector/index.vue index fcc9d841c..45c9a4a48 100644 --- a/packages/ui/certd-client/src/views/certd/notification/notification-selector/index.vue +++ b/packages/ui/certd-client/src/views/certd/notification/notification-selector/index.vue @@ -136,12 +136,12 @@ async function emitValue(value: any) { if (isEnterprice) { const projectId = projectStore.currentProjectId; - if (pipeline.value.projectId !== projectId) { + if (pipeline?.value?.projectId !== projectId) { message.error("对不起,您不能修改其他项目流水线的通知"); return; } } else { - if (pipeline.value.userId !== userId) { + if (pipeline?.value?.userId !== userId) { message.error("对不起,您不能修改他人流水线的通知"); return; } diff --git a/packages/ui/certd-server/src/plugins/plugin-dnsmgr/access.ts b/packages/ui/certd-server/src/plugins/plugin-dnsmgr/access.ts index a647ad9e8..9d05507ee 100644 --- a/packages/ui/certd-server/src/plugins/plugin-dnsmgr/access.ts +++ b/packages/ui/certd-server/src/plugins/plugin-dnsmgr/access.ts @@ -66,7 +66,6 @@ export class DnsmgrAccess extends BaseAccess { const total = resp?.total || 0; let list = resp?.rows?.map((item: any) => { return { - id: item.id, domain: item.name, ...item, }; @@ -77,6 +76,8 @@ export class DnsmgrAccess extends BaseAccess { }; } + + async createDnsRecord(domainId: string, record: string, value: string, type: string, domain: string) { this.ctx.logger.info(`创建DNS记录:${record} ${type} ${value}`); const resp = await this.doRequest({ diff --git a/packages/ui/certd-server/src/plugins/plugin-dnsmgr/dns-provider.ts b/packages/ui/certd-server/src/plugins/plugin-dnsmgr/dns-provider.ts index 2a1b4aed7..fb201e96e 100644 --- a/packages/ui/certd-server/src/plugins/plugin-dnsmgr/dns-provider.ts +++ b/packages/ui/certd-server/src/plugins/plugin-dnsmgr/dns-provider.ts @@ -1,5 +1,6 @@ -import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert'; +import { AbstractDnsProvider, CreateRecordOptions, DomainRecord, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert'; import { DnsmgrAccess } from './access.js'; +import { PageRes, PageSearch } from '@certd/pipeline'; type DnsmgrRecord = { domainId: string; @@ -28,7 +29,7 @@ export class DnsmgrDnsProvider extends AbstractDnsProvider { this.logger.info('添加域名解析:', fullRecord, value, type, domain); const domainList = await this.access.GetDomainList({ searchKey: domain }); - const domainInfo = domainList.list?.find((item: any) => item.domain === domain); + const domainInfo = domainList.list?.find((item: any) => item.name === domain); if (!domainInfo) { throw new Error(`未找到域名:${domain}`); @@ -54,6 +55,17 @@ export class DnsmgrDnsProvider extends AbstractDnsProvider { this.logger.info('删除域名解析成功:', fullRecord, value); } + + async getDomainListPage(req: PageSearch): Promise> { + const res = await this.access.GetDomainList(req); + res.list = res.list?.map((item: any) => { + return { + id: item.id, + domain: item.name, + }; + }); + return res; + } } new DnsmgrDnsProvider();