mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
fix: 修复1panel 请求失败的bug
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { cloneDeep } from "lodash-es";
|
||||
|
||||
export function getInputFromForm(form: any, pluginType: string) {
|
||||
form = cloneDeep(form);
|
||||
let input: any = {};
|
||||
const record: any = form;
|
||||
if (pluginType === "plugin") {
|
||||
input = form?.input || {};
|
||||
delete form.input;
|
||||
} else if (pluginType === "access") {
|
||||
input = form?.access || {};
|
||||
delete form.access;
|
||||
} else if (pluginType === "notification") {
|
||||
input = form?.body || {};
|
||||
delete form.body;
|
||||
} else if (pluginType === "addon") {
|
||||
input = form?.body || {};
|
||||
delete form.body;
|
||||
} else {
|
||||
throw new Error(`pluginType ${pluginType} not support`);
|
||||
}
|
||||
return {
|
||||
input,
|
||||
record,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user