mirror of https://github.com/certd/certd
fix: 修复西部数码账户级别apikey不可用的bug
parent
f2f56adfd7
commit
f8f3e8b43f
|
@ -3,7 +3,7 @@
|
||||||
"version": "1.25.8",
|
"version": "1.25.8",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": ""
|
"build": "echo 'basic'"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { HttpClient, IAccess, ILogger, Registrable } from "@certd/pipeline";
|
import { HttpClient, IAccess, ILogger, Registrable, utils } from "@certd/pipeline";
|
||||||
|
|
||||||
export type DnsProviderDefine = Registrable & {
|
export type DnsProviderDefine = Registrable & {
|
||||||
accessType: string;
|
accessType: string;
|
||||||
|
@ -22,6 +22,7 @@ export type DnsProviderContext = {
|
||||||
access: IAccess;
|
access: IAccess;
|
||||||
logger: ILogger;
|
logger: ILogger;
|
||||||
http: HttpClient;
|
http: HttpClient;
|
||||||
|
utils: typeof utils;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IDnsProvider<T = any> {
|
export interface IDnsProvider<T = any> {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Decorator, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
|
import { Decorator, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, utils } from "@certd/pipeline";
|
||||||
import type { CertInfo, PrivateKeyType, SSLProvider } from "./acme.js";
|
import type { CertInfo, PrivateKeyType, SSLProvider } from "./acme.js";
|
||||||
import { AcmeService } from "./acme.js";
|
import { AcmeService } from "./acme.js";
|
||||||
import _ from "lodash-es";
|
import _ from "lodash-es";
|
||||||
|
@ -181,7 +181,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const dnsProvider: IDnsProvider = new DnsProviderClass();
|
const dnsProvider: IDnsProvider = new DnsProviderClass();
|
||||||
const context: DnsProviderContext = { access, logger: this.logger, http: this.http };
|
const context: DnsProviderContext = { access, logger: this.logger, http: this.http, utils };
|
||||||
Decorator.inject(dnsProviderDefine.autowire, dnsProvider, context);
|
Decorator.inject(dnsProviderDefine.autowire, dnsProvider, context);
|
||||||
dnsProvider.setCtx(context);
|
dnsProvider.setCtx(context);
|
||||||
await dnsProvider.onInstance();
|
await dnsProvider.onInstance();
|
||||||
|
|
|
@ -68,6 +68,9 @@ function install(app: App, options: any = {}) {
|
||||||
},
|
},
|
||||||
conditionalRender: {
|
conditionalRender: {
|
||||||
match(scope) {
|
match(scope) {
|
||||||
|
if (scope.key === "__blank__") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//不能用 !scope.value , 否则switch组件设置为关之后就消失了
|
//不能用 !scope.value , 否则switch组件设置为关之后就消失了
|
||||||
const { value, key, props } = scope;
|
const { value, key, props } = scope;
|
||||||
return !value && key != "_index" && value != false;
|
return !value && key != "_index" && value != false;
|
||||||
|
@ -147,17 +150,18 @@ function install(app: App, options: any = {}) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
columns: {
|
columns: {
|
||||||
// createdAt: {
|
__blank__: {
|
||||||
// title: "创建时间",
|
title: "",
|
||||||
// type: "datetime",
|
type: "text",
|
||||||
// form: {
|
form: {
|
||||||
// show: false
|
show: false
|
||||||
// },
|
},
|
||||||
// column: {
|
column: {
|
||||||
// show: false,
|
show: true,
|
||||||
// order: 1000
|
order: 999999,
|
||||||
// }
|
width: -1
|
||||||
// }
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -185,11 +185,19 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
||||||
minWidth: 200,
|
minWidth: 200,
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
buttons: {
|
buttons: {
|
||||||
view: {
|
play: {
|
||||||
|
title: null,
|
||||||
|
type: "link",
|
||||||
|
icon: "ant-design:play-outlined",
|
||||||
click({ row }) {
|
click({ row }) {
|
||||||
router.push({ path: "/certd/pipeline/detail", query: { id: row.id, editMode: "false" } });
|
router.push({ path: "/certd/pipeline/detail", query: { id: row.id, editMode: "false" } });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// view: {
|
||||||
|
// click({ row }) {
|
||||||
|
// router.push({ path: "/certd/pipeline/detail", query: { id: row.id, editMode: "false" } });
|
||||||
|
// }
|
||||||
|
// },
|
||||||
copy: {
|
copy: {
|
||||||
click: async (context) => {
|
click: async (context) => {
|
||||||
userStore.checkPlus();
|
userStore.checkPlus();
|
||||||
|
@ -260,7 +268,7 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
width: 50
|
width: 100
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
show: false
|
show: false
|
||||||
|
@ -280,7 +288,8 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
||||||
column: {
|
column: {
|
||||||
show: computed(() => {
|
show: computed(() => {
|
||||||
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
|
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
|
||||||
})
|
}),
|
||||||
|
width: 100
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
|
@ -306,9 +315,11 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
title: "定时任务数量",
|
title: "定时任务数",
|
||||||
type: "number",
|
type: "number",
|
||||||
column: {
|
column: {
|
||||||
|
align: "center",
|
||||||
|
width: 100,
|
||||||
cellRender({ value }) {
|
cellRender({ value }) {
|
||||||
if (value && value.triggers) {
|
if (value && value.triggers) {
|
||||||
return value.triggers?.length > 0 ? value.triggers.length : "-";
|
return value.triggers?.length > 0 ? value.triggers.length : "-";
|
||||||
|
@ -346,7 +357,7 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
||||||
const percent = (leftDays / 90) * 100;
|
const percent = (leftDays / 90) * 100;
|
||||||
return <a-progress percent={percent} strokeColor={color} format={(percent: number) => `${leftDays} 天`} />;
|
return <a-progress percent={percent} strokeColor={color} format={(percent: number) => `${leftDays} 天`} />;
|
||||||
},
|
},
|
||||||
width: 110
|
width: 150
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lastHistoryTime: {
|
lastHistoryTime: {
|
||||||
|
@ -357,7 +368,7 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 120,
|
width: 150,
|
||||||
align: "center"
|
align: "center"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -415,6 +426,7 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
||||||
helper: "历史记录保持条数,多余的会被删除"
|
helper: "历史记录保持条数,多余的会被删除"
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
|
width: 130,
|
||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -438,7 +450,7 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 125,
|
width: 155,
|
||||||
align: "center"
|
align: "center"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -449,6 +461,7 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
|
width: 125,
|
||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ export class WestDnsProvider extends AbstractDnsProvider<westRecord> {
|
||||||
|
|
||||||
private async doRequestApi(url: string, data: any = null, method = 'post') {
|
private async doRequestApi(url: string, data: any = null, method = 'post') {
|
||||||
if (this.access.scope === 'account') {
|
if (this.access.scope === 'account') {
|
||||||
data.apikey = this.access.apikey;
|
data.apikey = this.ctx.utils.hash.md5(this.access.apikey);
|
||||||
data.username = this.access.username;
|
data.username = this.access.username;
|
||||||
} else {
|
} else {
|
||||||
data.apidomainkey = this.access.apidomainkey;
|
data.apidomainkey = this.access.apidomainkey;
|
||||||
|
|
Loading…
Reference in New Issue