Sfoglia il codice sorgente

修复"边栏"权限控制问题

F。 4 mesi fa
parent
commit
f23be16e98
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      web/src/hooks/common/useSidebar.js

+ 3 - 2
web/src/hooks/common/useSidebar.js

@@ -128,8 +128,9 @@ export const useSidebar = () => {
 
   // 刷新用户配置的方法(供外部调用)
   const refreshUserConfig = async () => {
-    // 移除adminConfig的条件限制,直接刷新用户配置
-    await loadUserConfig();
+     if (Object.keys(adminConfig).length > 0) {
+      await loadUserConfig();
+    }
 
     // 触发全局刷新事件,通知所有useSidebar实例更新
     sidebarEventTarget.dispatchEvent(new CustomEvent(SIDEBAR_REFRESH_EVENT));