diff --git a/src/modules/system/plugins/layouts/PluginLayout.vue b/src/modules/system/plugins/layouts/PluginLayout.vue index 94d77433..85975510 100644 --- a/src/modules/system/plugins/layouts/PluginLayout.vue +++ b/src/modules/system/plugins/layouts/PluginLayout.vue @@ -25,6 +25,7 @@ import BasicLayout from "@/layouts/BasicLayout.vue"; import type { Ref } from "vue"; import type { Plugin, SettingForm } from "@halo-dev/api-client"; import { usePermission } from "@/utils/permission"; +import { usePluginLifeCycle } from "../composables/use-plugin"; const { currentUserHasPermission } = usePermission(); @@ -60,6 +61,8 @@ provide>("activeTab", activeTab); const settingName = computed(() => plugin.value?.spec.settingName); const configMapName = computed(() => plugin.value?.spec.configMapName); +const { isStarted } = usePluginLifeCycle(plugin); + const { setting, handleFetchSettings } = useSettingForm( settingName, configMapName @@ -112,7 +115,9 @@ onMounted(async () => { return; } - await handleFetchSettings(); + if (isStarted.value) { + await handleFetchSettings(); + } tabs.value = cloneDeep(initialTabs);