mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
Merge branch 'v2-dev' into v2
This commit is contained in:
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.27.4](https://github.com/certd/certd/compare/v1.27.3...v1.27.4) (2024-11-14)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 公共cname服务支持关闭 ([f4ae512](https://github.com/certd/certd/commit/f4ae5125dc4cd97816976779cb3586b5ee78947e))
|
||||
|
||||
## [1.27.3](https://github.com/certd/certd/compare/v1.27.2...v1.27.3) (2024-11-13)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.27.3",
|
||||
"version": "1.27.4",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -29,17 +29,17 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@certd/acme-client": "^1.27.3",
|
||||
"@certd/basic": "^1.27.3",
|
||||
"@certd/commercial-core": "^1.27.3",
|
||||
"@certd/lib-huawei": "^1.27.3",
|
||||
"@certd/lib-k8s": "^1.27.3",
|
||||
"@certd/lib-server": "^1.27.3",
|
||||
"@certd/midway-flyway-js": "^1.27.3",
|
||||
"@certd/pipeline": "^1.27.3",
|
||||
"@certd/plugin-cert": "^1.27.3",
|
||||
"@certd/plugin-plus": "^1.27.3",
|
||||
"@certd/plus-core": "^1.27.3",
|
||||
"@certd/acme-client": "^1.27.4",
|
||||
"@certd/basic": "^1.27.4",
|
||||
"@certd/commercial-core": "^1.27.4",
|
||||
"@certd/lib-huawei": "^1.27.4",
|
||||
"@certd/lib-k8s": "^1.27.4",
|
||||
"@certd/lib-server": "^1.27.4",
|
||||
"@certd/midway-flyway-js": "^1.27.4",
|
||||
"@certd/pipeline": "^1.27.4",
|
||||
"@certd/plugin-cert": "^1.27.4",
|
||||
"@certd/plugin-plus": "^1.27.4",
|
||||
"@certd/plus-core": "^1.27.4",
|
||||
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
|
||||
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
|
||||
"@koa/cors": "^5.0.0",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
import { InjectEntityModel } from '@midwayjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { BaseService, ListReq, ValidateException } from '@certd/lib-server';
|
||||
import { BaseService, ListReq, SysPrivateSettings, SysSettingsService, ValidateException } from '@certd/lib-server';
|
||||
import { CnameProviderEntity } from '../entity/cname-provider.js';
|
||||
import { CommonProviders } from './common-provider.js';
|
||||
|
||||
@@ -14,6 +14,9 @@ export class CnameProviderService extends BaseService<CnameProviderEntity> {
|
||||
@InjectEntityModel(CnameProviderEntity)
|
||||
repository: Repository<CnameProviderEntity>;
|
||||
|
||||
@Inject()
|
||||
settingsService: SysSettingsService;
|
||||
|
||||
//@ts-ignore
|
||||
getRepository() {
|
||||
return this.repository;
|
||||
@@ -85,7 +88,10 @@ export class CnameProviderService extends BaseService<CnameProviderEntity> {
|
||||
if (founds && founds.length > 0) {
|
||||
return founds[0];
|
||||
}
|
||||
if (CommonProviders.length > 0) {
|
||||
|
||||
const sysPrivateSettings = await this.settingsService.getSetting<SysPrivateSettings>(SysPrivateSettings);
|
||||
|
||||
if (sysPrivateSettings.commonCnameEnabled !== false && CommonProviders.length > 0) {
|
||||
return CommonProviders[0] as CnameProviderEntity;
|
||||
}
|
||||
return null;
|
||||
@@ -93,8 +99,12 @@ export class CnameProviderService extends BaseService<CnameProviderEntity> {
|
||||
|
||||
async list(req: ListReq): Promise<any[]> {
|
||||
const list = await super.list(req);
|
||||
const sysPrivateSettings = await this.settingsService.getSetting<SysPrivateSettings>(SysPrivateSettings);
|
||||
|
||||
return [...list, ...CommonProviders];
|
||||
if (sysPrivateSettings.commonCnameEnabled !== false) {
|
||||
return [...list, ...CommonProviders];
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
async info(id: any, infoIgnoreProperty?: any): Promise<any | null> {
|
||||
|
||||
@@ -135,5 +135,6 @@ export class RoleService extends BaseService<RoleEntity> {
|
||||
if (urs.length > 0) {
|
||||
throw new Error('该角色已被用户使用,无法删除');
|
||||
}
|
||||
await this.deleteWhere({ id: In(idArr) });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
|
||||
import { CertInfo, CertReader } from '@certd/plugin-cert';
|
||||
import { isDev } from '../../../utils/env.js';
|
||||
import { isDev } from '@certd/basic';
|
||||
|
||||
@IsTaskPlugin({
|
||||
name: 'demoTest',
|
||||
title: 'Demo测试插件',
|
||||
icon: 'clarity:plugin-line',
|
||||
//插件分组
|
||||
group: pluginGroups.other.key,
|
||||
default: {
|
||||
strategy: {
|
||||
runStrategy: RunStrategy.SkipWhenSucceed,
|
||||
},
|
||||
},
|
||||
// 你开发的插件要删除此项,否则不会在生产环墋中显示
|
||||
deprecated: isDev() ? '测试插件,生产环境不显示' : undefined,
|
||||
})
|
||||
export class DemoTestPlugin extends AbstractTaskPlugin {
|
||||
//测试参数
|
||||
@TaskInput({
|
||||
title: '属性示例',
|
||||
value: '默认值',
|
||||
component: {
|
||||
//前端组件配置,具体配置见组件文档 https://www.antdv.com/components/input-cn
|
||||
name: 'a-input',
|
||||
@@ -57,7 +61,7 @@ export class DemoTestPlugin extends AbstractTaskPlugin {
|
||||
name: 'output-selector',
|
||||
from: ['CertApply', 'CertApplyLego'],
|
||||
},
|
||||
// required: true,
|
||||
// required: true, // 必填
|
||||
})
|
||||
cert!: CertInfo;
|
||||
|
||||
@@ -70,6 +74,7 @@ export class DemoTestPlugin extends AbstractTaskPlugin {
|
||||
type: 'demo', //固定授权类型
|
||||
},
|
||||
// rules: [{ required: true, message: '此项必填' }],
|
||||
// required: true, //必填
|
||||
})
|
||||
accessId!: string;
|
||||
|
||||
@@ -98,8 +103,5 @@ export class DemoTestPlugin extends AbstractTaskPlugin {
|
||||
this.logger.info('授权id:', accessId);
|
||||
}
|
||||
}
|
||||
//TODO 这里实例化插件,进行注册
|
||||
if (isDev()) {
|
||||
//你的实现 要去掉这个if,不然生产环境将不会显示
|
||||
new DemoTestPlugin();
|
||||
}
|
||||
//实例化一下,注册插件
|
||||
new DemoTestPlugin();
|
||||
|
||||
Reference in New Issue
Block a user