mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
chore: oidc first
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { request } from "/src/api/service";
|
||||
import { RequestHandleReq } from "/@/components/plugins/lib";
|
||||
import { AddonTypeDefines } from "./types";
|
||||
|
||||
export function createAddonApi(opts: { from: any; addonType: string }) {
|
||||
export function createAddonApi(opts: { from: any; addonType: string } = { from: "user", addonType: "" }) {
|
||||
let apiPrefix = "/addon";
|
||||
if (opts.from === "sys") {
|
||||
apiPrefix = "/sys/addon";
|
||||
@@ -128,15 +129,6 @@ export function createAddonApi(opts: { from: any; addonType: string }) {
|
||||
};
|
||||
}
|
||||
|
||||
export const AddonTypeDefines = {
|
||||
captcha: {
|
||||
name: "captcha",
|
||||
title: "验证码",
|
||||
showDefault: false,
|
||||
showTest: false,
|
||||
},
|
||||
};
|
||||
|
||||
export function getAddonTypeDefine(addonType: string) {
|
||||
return AddonTypeDefines[addonType];
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import { addonProvide } from "/@/views/certd/addon/common";
|
||||
export default defineComponent({
|
||||
name: "AddonManager",
|
||||
setup() {
|
||||
const api = createAddonApi();
|
||||
const api = createAddonApi({ from: "user", addonType: "" });
|
||||
addonProvide(api);
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { api } });
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
export interface AddonTypeDefine {
|
||||
name: string;
|
||||
title: string;
|
||||
showDefault: boolean;
|
||||
showTest: boolean;
|
||||
}
|
||||
|
||||
export const AddonTypeDefines: Record<string, AddonTypeDefine> = {
|
||||
captcha: {
|
||||
name: "captcha",
|
||||
title: "验证码",
|
||||
showDefault: false,
|
||||
showTest: false,
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user