From 84ef795a1eecdb1c3f6c7f906bba4a33a299c10a Mon Sep 17 00:00:00 2001 From: SL <123@123.com> Date: Tue, 19 Sep 2023 15:52:46 +0800 Subject: [PATCH] =?UTF-8?q?[UI.Client]=20=E6=95=B4=E7=90=86BaseApp.cs?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ClientBase/BaseApp.cs | 61 ++++++++----------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/MECF.Framework.UI.Client/ClientBase/BaseApp.cs b/MECF.Framework.UI.Client/ClientBase/BaseApp.cs index 37515da..115ac7e 100644 --- a/MECF.Framework.UI.Client/ClientBase/BaseApp.cs +++ b/MECF.Framework.UI.Client/ClientBase/BaseApp.cs @@ -1,19 +1,38 @@ using System; using System.IO; -using System.Linq; using System.Reflection; -using System.Threading.Tasks; using Aitex.Core.Account; using Aitex.Core.RT.Log; using Caliburn.Micro; -using Caliburn.Micro.Core; using MECF.Framework.Common.Account.Extends; using MECF.Framework.Common.Utilities; +using MECF.Framework.UI.Client.CenterViews.Configs.Roles; namespace MECF.Framework.UI.Client.ClientBase { public class BaseApp { + + #region Variables + + public ModuleDataMonitor _dataMonitor; + + #endregion + + #region Constructors + + public BaseApp() + { + UserMode = UserMode.None; + Initialized = false; + + Configure(); + } + + #endregion + + #region Properites + public LoginClientInfo ClientInfo { get; private set; } public UserContext UserContext { get; private set; } @@ -24,23 +43,12 @@ namespace MECF.Framework.UI.Client.ClientBase public bool Initialized { get; private set; } - public ModuleDataMonitor _dataMonitor; + public static BaseApp Instance { get; set; } - private static BaseApp _instance = null; + #endregion - public static BaseApp Instance - { - get => _instance; - set => _instance = value; - } + #region Methods - public BaseApp() - { - UserMode = UserMode.None; - Initialized = false; - - Configure(); - } public void LoadSystemInfo() { @@ -69,6 +77,7 @@ namespace MECF.Framework.UI.Client.ClientBase if (Initialized && !force) return; + RoleManager.Instance.Initialize(); MenuManager = new MenuManager(); UserContext = new UserContext(); @@ -110,22 +119,6 @@ namespace MECF.Framework.UI.Client.ClientBase { } - public int GetPermission(string menuid) - { - var per = 1; - if (UserContext != null) - { - var list = UserContext.Role.PermissionContent.Split(';'); - var result = from r in list - where r.Split(',')[0] == menuid - select r; - if (result.Count() > 0) - per = int.Parse(result.ToArray()[0].Split(',')[1]); - } - - return per; - } - - + #endregion } }