fix: 修复1panel 请求失败的bug

This commit is contained in:
xiaojunnuo
2026-02-15 12:59:08 +08:00
parent 8387fe0d5b
commit 0283662931
11 changed files with 63 additions and 44 deletions
@@ -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,
};
}