From 6bcafc823e836ecd5790f87178a906333699f868 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 10 四月 2025 10:46:47 +0800
Subject: [PATCH] 优化插件结构;

---
 HMI.Base/PluginLoader.cs |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/HMI.Base/PluginLoader.cs b/HMI.Base/PluginLoader.cs
index ae11ccb..6b4ba0b 100644
--- a/HMI.Base/PluginLoader.cs
+++ b/HMI.Base/PluginLoader.cs
@@ -62,6 +62,7 @@
         }
 
         private IPluginContainer pluginContainer;
+
         public void LoadMenuAndPlugin(IPluginContainer container, Dispatcher dispatcher)
         {
             pluginContainer = container;
@@ -76,6 +77,7 @@
                 });
             }
         }
+
         private void LoadChildrenMenu()
         {
             foreach (var menu in Plugins)
@@ -139,7 +141,7 @@
                     }
                     catch (Exception ex)
                     {
-                        log.Error("Load Plugin Failed.", ex);
+                        log.Error($"Load Plugin [{menu.Name}] Failed.", ex);
                         LoadMessageAppend?.Invoke(this, new LoadMsg
                         {
                             Type = LoadMsgType.LOADING,
@@ -167,7 +169,7 @@
                 string sql = $@"SELECT m.* FROM menu AS m INNER JOIN role_menu_rel AS rrel ON m.code = rrel.menuCode
 INNER JOIN role AS r ON rrel.roleCode = r.code
 INNER JOIN user_role_rel AS urel ON r.code = urel.roleCode
-AND urel.username = '{user.Username}' ORDER BY m.level, m.id;";
+AND urel.username = '{user.Username}' ORDER BY m.level,m.sort, m.id;";
 
                 DataTable dt = sqliteHelper.GetDataTable(sql);
                 if (dt != null)
@@ -217,6 +219,5 @@
             }
             return data;
         }
-
     }
 }

--
Gitblit v1.9.1