mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
perf: 部署支持1Panel
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { request } from "/@/api/service";
|
||||
export type ComponentPropsType = {
|
||||
type: string;
|
||||
typeName: string;
|
||||
action: string;
|
||||
form: any;
|
||||
value?: any;
|
||||
};
|
||||
export type RequestHandleReq<T = any> = {
|
||||
type: strin;
|
||||
typeName: string;
|
||||
action: string;
|
||||
data: any;
|
||||
input: T;
|
||||
};
|
||||
|
||||
export async function doRequest(req: RequestHandleReq) {
|
||||
const url = req.type === "access" ? "/pi/handle/access" : "/pi/handle/plugin";
|
||||
const { typeName, action, data, input } = req;
|
||||
const res = await request({
|
||||
url,
|
||||
method: "post",
|
||||
data: {
|
||||
typeName,
|
||||
action,
|
||||
data,
|
||||
input
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
Reference in New Issue
Block a user