mirror of
https://github.com/certd/certd.git
synced 2026-05-16 05:07:32 +08:00
refactor(core): 重构访问控制和插件实例化逻辑
- 修改访问控制和插件注册方式,使用异步函数统一实例化逻辑 - 更新相关组件和控制器以适应新的异步实例化方式 - 优化 DNS 提供商选择器,增加访问类型支持
This commit is contained in:
@@ -5,6 +5,6 @@ const apiPrefix = "/pi/dnsProvider";
|
||||
export async function GetList() {
|
||||
return await request({
|
||||
url: apiPrefix + "/list",
|
||||
method: "post"
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
|
||||
+18
-6
@@ -11,10 +11,10 @@ export default {
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
default: undefined,
|
||||
},
|
||||
},
|
||||
emits: ["update:modelValue"],
|
||||
emits: ["update:modelValue", "selected-change"],
|
||||
setup(props: any, ctx: any) {
|
||||
const options = ref<any[]>([]);
|
||||
|
||||
@@ -25,24 +25,36 @@ export default {
|
||||
array.push({
|
||||
value: item.name,
|
||||
label: item.title,
|
||||
icon: item.icon
|
||||
icon: item.icon,
|
||||
accessType: item.accessType,
|
||||
});
|
||||
}
|
||||
options.value = array;
|
||||
// if (props.modelValue == null && options.value.length > 0) {
|
||||
// ctx.emit("update:modelValue", options.value[0].value);
|
||||
// }
|
||||
onSelectedChange(props.modelValue);
|
||||
}
|
||||
onCreate();
|
||||
|
||||
function onChanged(value: any) {
|
||||
ctx.emit("update:modelValue", value);
|
||||
onSelectedChange(value);
|
||||
}
|
||||
function onSelectedChange(value: any) {
|
||||
if (value) {
|
||||
const option = options.value.find(item => item.value == value);
|
||||
if (option) {
|
||||
ctx.emit("selected-change", option);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
options,
|
||||
onChanged
|
||||
onChanged,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user