From 350db91dd2d9c8a0aad8be28955b117205d44c44 Mon Sep 17 00:00:00 2001 From: shuai Date: Wed, 6 Nov 2024 11:37:06 +0800 Subject: [PATCH] fix: fixed project initialization not allowing access to the plug-in interface, causing the page to continue loading #1162 --- ui/src/utils/pluginKit/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/src/utils/pluginKit/index.ts b/ui/src/utils/pluginKit/index.ts index 346c1456a..a71a95390 100644 --- a/ui/src/utils/pluginKit/index.ts +++ b/ui/src/utils/pluginKit/index.ts @@ -56,7 +56,8 @@ class Plugins { async init() { this.registerBuiltin(); - const plugins = await getPluginsStatus().catch(() => []); + // Note: The /install stage does not allow access to the getPluginsStatus api, so an initial value needs to be given + const plugins = (await getPluginsStatus().catch(() => [])) || []; this.registeredPlugins = plugins.filter((p) => p.enabled); await this.registerPlugins(); } @@ -169,6 +170,7 @@ const validateRoutePlugin = async (slugName) => { const mergeRoutePlugins = async (routes) => { const routePlugins = await getRoutePlugins(); + console.log('routePlugins', routePlugins); if (routePlugins.length === 0) { return routes; }