From 5727cf0b9b54da0a191dd1e23cb5abf21320fbff Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 25 十一月 2019 10:34:17 +0800 Subject: [PATCH] IOS使用新的项目名称 --- ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs | 86 +++++++++++++++++++++++-------------------- 1 files changed, 46 insertions(+), 40 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs index cd51328..84ce50c 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs @@ -26,7 +26,8 @@ { get { - if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2) + if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2 + || Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 3) { return AdminMqttKey; } @@ -41,7 +42,8 @@ { get { - if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2) + if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2 + || Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 3) { return AdminZigbeeMqttBrokerLoadSubDomain; } @@ -56,7 +58,8 @@ { get { - if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2) + if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2 + || Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 3) { return AdminConnectZigbeeMqttClientId; } @@ -71,7 +74,8 @@ { get { - if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2) + if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2 + || Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 3) { return AdminConnectZigbeeMqttBrokerPwd; } @@ -86,13 +90,29 @@ { get { - if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2) + if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2 + || Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 3) { return AdminConnectZigbeeMqttBrokerName; } return Config.Instance.Account; - } - } + } + } + /// <summary> + /// 褰撳墠闇�瑕佽繛鎺ヤ簯绔痁igbeeMqttBroker鐨勮繛鎺ョ殑瀵嗙爜 + /// </summary> + public string ConnectGuid + { + get + { + if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2 + || Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 3) + { + return AdminConnectZigbeeMqttBrokerName; + } + return Config.Instance.Guid; + } + } /// <summary> /// 璐︽埛鐧诲綍鎴愬姛鐨凪qttKey @@ -162,10 +182,7 @@ /// 璐︽埛鐧诲綍鎴愬姛鐨勪富ID /// </summary> public int MasterID = 0; - /// <summary> - /// 鐢ㄦ埛ID - /// </summary> - public int UserID = 0; + public static void ReFresh() { @@ -177,7 +194,7 @@ config = new Config { }; } } - + /// <summary> /// 褰撳墠鐧诲綍鐨勫笎鍙� /// </summary> @@ -236,12 +253,6 @@ { get { - //鍚敤绠$悊鍛樻潈闄� - if (this.isAdministrator == true) - { - return this.AdminRequestToken; - } - string md5Password; if (string.IsNullOrEmpty(Password)) { @@ -263,29 +274,16 @@ } /// <summary> - /// 褰撳墠甯愬彿鐨凾oken(鎷ユ湁绠$悊鍛樻潈闄愮殑鎴愬憳浣跨敤杩滅▼鐨勬椂鍊欎娇鐢�) - /// </summary> - public string AdminToken - { - get - { - if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2) - { - return this.AdminRequestToken; - } - return this.Token; - } - } - - /// <summary> /// 鐧诲綍杩囩殑甯愬彿淇℃伅 /// </summary> public List<string> AccountList = new List<string> { }; public List<string> HomeFilePathList = new List<string> { }; - public string HomeId = string.Empty; - + public string HomeId = string.Empty; + + [Newtonsoft.Json.JsonIgnore] + private House m_Home = null; /// <summary> /// 褰撳墠浣忓畢 /// </summary> @@ -295,12 +293,20 @@ { get { - var house = House.GetHouseByHouseId(HomeId); - if (house == null) - { - return new House { }; + if (m_Home != null) + { + return m_Home; } - return house; + m_Home = House.GetHouseByHouseId(HomeId); + if (m_Home == null) + { + m_Home = new House(); + } + return m_Home; + } + set + { + m_Home = value; } } -- Gitblit v1.8.0