perf: 所有授权增加测试按钮

This commit is contained in:
xiaojunnuo
2026-02-15 18:44:35 +08:00
parent 42c7ec2f75
commit 7a3e68d656
39 changed files with 1876 additions and 662 deletions
@@ -1,4 +1,6 @@
import { IsAccess, AccessInput, BaseAccess } from "@certd/pipeline";
import { CtyunClient } from "../lib.js";
import { HttpClient } from "@certd/basic";
@IsAccess({
name: "ctyun",
@@ -27,6 +29,37 @@ export class CtyunAccess extends BaseAccess {
helper: "",
})
securityKey = "";
@AccessInput({
title: "测试",
component: {
name: "api-test",
action: "TestRequest",
},
helper: "点击测试接口看是否正常",
})
testRequest = true;
async onTestRequest() {
await this.getCdnDomainList()
return "ok";
}
async getCdnDomainList() {
const http: HttpClient = this.ctx.http;
const client = new CtyunClient({
access:this,
http,
logger: this.ctx.logger,
});
// 008 是天翼云的CDN加速域名产品码
const all = await client.getDomainList({ productCode: "008" });
const list = all || []
return list
}
}
new CtyunAccess();