mirror of
https://github.com/certd/certd.git
synced 2026-05-16 05:07:32 +08:00
perf: 所有授权增加测试按钮
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { IsAccess, AccessInput, BaseAccess } from '@certd/pipeline';
|
||||
import { DogeClient } from './lib/index.js';
|
||||
|
||||
/**
|
||||
* 这个注解将注册一个授权配置
|
||||
@@ -35,6 +36,25 @@ export class DogeCloudAccess extends BaseAccess {
|
||||
encrypt: true,
|
||||
})
|
||||
secretKey = '';
|
||||
|
||||
@AccessInput({
|
||||
title: "测试",
|
||||
component: {
|
||||
name: "api-test",
|
||||
action: "TestRequest"
|
||||
},
|
||||
helper: "测试授权是否正确"
|
||||
})
|
||||
testRequest = true;
|
||||
|
||||
async onTestRequest() {
|
||||
const dogeClient = new DogeClient(this, this.ctx.http, this.ctx.logger);
|
||||
await dogeClient.request(
|
||||
'/cdn/domain/list.json',
|
||||
{},
|
||||
);
|
||||
return "ok";
|
||||
}
|
||||
}
|
||||
|
||||
new DogeCloudAccess();
|
||||
|
||||
Reference in New Issue
Block a user