From e90209beae6a4e822cecb18e6889f8bda23f630e Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 14 十二月 2020 11:16:06 +0800 Subject: [PATCH] 合并了晾衣架(非新云端) --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlCheckLogic.cs | 76 ++++++++----------------------------- 1 files changed, 17 insertions(+), 59 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Common/Logic/HdlCheckLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlCheckLogic.cs similarity index 80% rename from ZigbeeApp/Shared/Phone/Common/Logic/HdlCheckLogic.cs rename to ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlCheckLogic.cs index 0da5903..6a47baf 100644 --- a/ZigbeeApp/Shared/Phone/Common/Logic/HdlCheckLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlCheckLogic.cs @@ -4,7 +4,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace Shared.Phone +namespace Shared.Phone.UserCenter { public class HdlCheckLogic { @@ -84,8 +84,7 @@ /// <returns></returns> public bool CheckEmail(string email) { - string emailRegexStr = "^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"; - Regex reg = new Regex(emailRegexStr); + Regex reg = new Regex(CommonPage.EmailRegexStr); return reg.IsMatch(email); } @@ -100,7 +99,7 @@ //鏍¢獙澶栧浗鎵嬫満鍙� if (areaCode != "86") { - Regex reg = new Regex("^[0-9]*$"); + Regex reg = new Regex(CommonPage.PhoneForForeignRegexStr); return reg.IsMatch(phoneNumber); } @@ -111,7 +110,7 @@ } else if (phoneNumber.Length == 11) { - Regex reg = new Regex("^[1][0-9]{10}$"); + Regex reg = new Regex(CommonPage.PhoneRegexStr); return reg.IsMatch(phoneNumber); } else @@ -139,23 +138,9 @@ return true; } - /// <summary> - /// 妫�鏌ュ瘑鐮侀暱搴﹀悎娉曟�� - /// </summary> - /// <param name="password"></param> - /// <returns></returns> - public bool CheckPwdLength(string password) - { - if (password.Trim().Length >= 6 && password.Trim().Length <= 13) - { - return true; - } - return false; - } - #endregion - #region 鈻� 妫�娴嬬綉鍏抽敊璇姸鎬佺爜_________________ + #region 鈻� 妫�娴嬬綉鍏冲叡閫氶敊璇姸鎬佺爜_____________ /// <summary> /// <para>妫�娴嬬綉鍏宠繑鍥炵殑鍏遍�氶敊璇姸鎬佺爜(杩斿洖null鍒欎唬琛ㄦ病鏈夐敊璇�),鏀寔鐘舵�佺爜涓�</para> @@ -167,7 +152,7 @@ /// </summary> /// <param name="resultData">缃戝叧杩斿洖鐨剅esultData,閲岄潰鏈夈�恊rrorResponData銆戣繖涓笢瑗跨殑閭g瀵硅薄</param> /// <returns></returns> - public string CheckGatewayErrorCode(object resultData) + public string CheckCommonErrorCode(object resultData) { if (resultData == null) { @@ -183,7 +168,7 @@ var code = type.InvokeMember("Error", System.Reflection.BindingFlags.GetField, null, errorObj, null); int errorCode = Convert.ToInt32(code); - return CheckGatewayErrorCode(errorCode); + return CheckCommonErrorCode(errorCode); } /// <summary> @@ -196,7 +181,7 @@ /// </summary> /// <param name="errorCode">閿欒浠g爜</param> /// <returns></returns> - public string CheckGatewayErrorCode(int errorCode) + public string CheckCommonErrorCode(int errorCode) { if (errorCode == 1) { @@ -206,51 +191,24 @@ else if (errorCode == 2) { //鍗忚皟鍣ㄦ鍦ㄥ崌绾ф垨澶囦唤鎴栨仮澶嶆暟鎹腑 - return Language.StringByID(R.MyInternationalizationString.uCoordinatorIsUpOrBackupOrRecovering); + string msg = Language.StringByID(R.MyInternationalizationString.uCoordinatorIsUpOrBackupOrRecovering); } else if (errorCode == 3) { //鐩爣璁惧涓嶅瓨鍦� - return Language.StringByID(R.MyInternationalizationString.uTargetDeviceIsNotExsit); + string msg = Language.StringByID(R.MyInternationalizationString.uTargetDeviceIsNotExsit); } else if (errorCode == 4) { //鍑虹幇鏈煡閿欒,璇风◢鍚庡啀璇� - return Language.StringByID(R.MyInternationalizationString.uUnKnowErrorAndResetAgain); + string msg = Language.StringByID(R.MyInternationalizationString.uUnKnowErrorAndResetAgain); } else if (errorCode == 5) { //鏁版嵁浼犺緭閿欒,璇风◢鍚庡啀璇� - return Language.StringByID(R.MyInternationalizationString.uDataTransmissionFailAndResetAgain); + string msg = Language.StringByID(R.MyInternationalizationString.uDataTransmissionFailAndResetAgain); } return null; - } - - #endregion - - #region 鈻� 妫�娴嬫帴鍙h繑鍥炵殑鐘舵�佺爜_______________ - - /// <summary> - /// 妫�娴嬫帴鍙h繑鍥炵殑鐘舵�佺爜 - /// </summary> - /// <param name="i_response">浜戠杩斿洖鐨勪笢瑗�</param> - /// <param name="i_mode">鏄惁鏄剧ず璁块棶鎺ュ彛澶辫触鐨則ip娑堟伅</param> - /// <returns></returns> - public bool CheckNetCode(ResponsePack i_response, ShowNetCodeMode i_mode) - { - //涓轰簡鑺傜渷浠g爜,杩欐牱鏁磋�屽凡 - if (i_response == null) - { - //缃戝叧杩炴帴澶辫触,璇风‘璁ょ綉缁� - HdlMessageLogic.Current.ShowNotNetTipMsg(i_mode); - return false; - } - if (i_response.Code != HttpMessageEnum.A鎴愬姛) - { - HdlMessageLogic.Current.ShowNetCodeTipMsg(i_mode, i_response); - return false; - } - return true; } #endregion @@ -298,7 +256,7 @@ TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = null; TouchIDUtils.TouchIDSupperType type = TouchIDUtils.getTouchIDSupperType(); - if (type == TouchIDUtils.TouchIDSupperType.TouchID && HdlUserCenterResourse.AccountOption.FingerprintAuthentication == true) + if (type == TouchIDUtils.TouchIDSupperType.TouchID && UserCenterResourse.AccountOption.FingerprintAuthentication == true) { //Touch ID楠岃瘉 TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent += (sender2, e2) => @@ -313,13 +271,13 @@ else if (e2 == TouchIDUtils.TouchIDState.InputPassword) { //瀵嗙爜楠岃瘉 - if (string.IsNullOrEmpty(HdlUserCenterResourse.AccountOption.PswAuthentication) == false) + if (string.IsNullOrEmpty(UserCenterResourse.AccountOption.PswAuthentication) == false) { var form = new PswSecondarySecurityForm(); form.AddForm(i_TouchText, i_PasswordText, i_GestureText, SuccessAction); } //鎵嬪娍楠岃瘉 - else if (string.IsNullOrEmpty(HdlUserCenterResourse.AccountOption.GestureAuthentication) == false) + else if (string.IsNullOrEmpty(UserCenterResourse.AccountOption.GestureAuthentication) == false) { var form = new PswGestureSecirityForm(); form.AddForm(i_TouchText, i_PasswordText, i_GestureText, SuccessAction); @@ -335,14 +293,14 @@ TouchIDUtils.Instance.showTouchIDWithDescribe(null, null); NotSettionAction = null; } - else if (string.IsNullOrEmpty(HdlUserCenterResourse.AccountOption.PswAuthentication) == false) + else if (string.IsNullOrEmpty(UserCenterResourse.AccountOption.PswAuthentication) == false) { //瀵嗙爜楠岃瘉 var form = new PswSecondarySecurityForm(); form.AddForm(i_TouchText, i_PasswordText, i_GestureText, SuccessAction); NotSettionAction = null; } - else if (string.IsNullOrEmpty(HdlUserCenterResourse.AccountOption.GestureAuthentication) == false) + else if (string.IsNullOrEmpty(UserCenterResourse.AccountOption.GestureAuthentication) == false) { //鎵嬪娍楠岃瘉 var form = new PswGestureSecirityForm(); -- Gitblit v1.8.0