mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
perf: 所有授权增加测试按钮
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user