perf: 支持部署到中国移动CDN

This commit is contained in:
xiaojunnuo
2025-12-04 00:46:25 +08:00
parent a5ca41131b
commit 43513049be
5 changed files with 600 additions and 0 deletions
@@ -0,0 +1,66 @@
import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline";
import { CmccClient } from "./cmcc-client.js";
/**
*
* tenantId: string;
tenantKey: string;
endpoint?: string;
*/
@IsAccess({
name: "cmcc",
title: "中国移动CND授权",
desc: "",
icon: "clarity:plugin-line"
})
export class CmccAccess extends BaseAccess {
@AccessInput({
title: 'TenantID',
component: {
placeholder: 'TenantID',
},
required: true,
})
tenantId = '';
@AccessInput({
title: 'TenantKey',
component: {
placeholder: 'TenantKey',
},
required: true,
encrypt: true,
})
tenantKey = '';
@AccessInput({
title: "测试",
component: {
name: "api-test",
action: "TestRequest"
},
helper: "点击测试接口是否正常"
})
testRequest = true;
async onTestRequest() {
const client = await this.getCmccClient()
await client.getDomainList({})
return "ok"
}
async getCmccClient() {
return new CmccClient({
tenantId: this.tenantId,
tenantKey: this.tenantKey,
http: this.ctx.http,
logger: this.ctx.logger,
})
}
}
new CmccAccess();