public override bool TakeAction() { try { DESAlgorithmNew des = new DESAlgorithmNew(); password = des.DecodePwd(password, "n7=7=7dk"); if (password.Length > 12 || password.Length < 4) { this.ErrorCode = LanguageManager.GetLang().ErrorCode; this.ErrorInfo = LanguageManager.GetLang().St1006_PasswordTooLong; return(false); } password = CryptoHelper.DES_Encrypt(password, "5^1-34E!"); if (SnsManager.ChangePass(Uid, password) <= 0) { this.ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St1006_ChangePasswordError; return(false); } } catch (Exception ex) { this.SaveLog(ex.ToString()); ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St1006_PasswordError; return(false); } return(true); }
public override bool TakeAction() { try { DESAlgorithmNew des = new DESAlgorithmNew(); password = des.DecodePwd(password, GameEnvironment.Setting.ClientDesDeKey); if (password.Length > 12 || password.Length < 4) { this.ErrorCode = Language.Instance.ErrorCode; this.ErrorInfo = Language.Instance.St1006_PasswordTooLong; return false; } password = CryptoHelper.DES_Encrypt(password, GameEnvironment.Setting.ProductDesEnKey); if (SnsManager.ChangePass(Uid, password) <= 0) { this.ErrorCode = Language.Instance.ErrorCode; ErrorInfo = Language.Instance.St1006_ChangePasswordError; return false; } } catch (Exception ex) { this.SaveLog(ex.ToString()); ErrorCode = Language.Instance.ErrorCode; ErrorInfo = Language.Instance.St1006_PasswordError; return false; } return true; }
public ResponseData Excute(PassportInfo data) { if (string.IsNullOrEmpty(data.PassportId) || string.IsNullOrEmpty(data.Password)) { throw new HandlerException(StateCode.Error, StateDescription.PasswordOrPassError); } data.Password = DecodePassword(data.Password); int result = SnsManager.ChangePass(data.PassportId, data.Password); if (result <= 0) { throw new HandlerException(StateCode.Error, StateDescription.ChangePassError); } return(new ResponseData()); }
public override bool TakeAction() { try { DESAlgorithmNew des = new DESAlgorithmNew(); password = des.DecodePwd(password, GameEnvironment.Setting.ClientDesDeKey); if (password.Length > 12 || password.Length < 4) { this.ErrorCode = LanguageManager.GetLang().ErrorCode; this.ErrorInfo = LanguageManager.GetLang().St1006_PasswordTooLong; return(false); } Regex re = new Regex(@"^[\u4e00-\u9fa5\w]+$"); if (!re.IsMatch(password)) { ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St1006_PasswordExceptional; return(false); } password = CryptoHelper.DES_Encrypt(password, GameEnvironment.Setting.ProductDesEnKey); if (SnsManager.ChangePass(Uid, password) <= 0) { this.ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St1006_ChangePasswordError; return(false); } else { UserOperationLog userOperationLog = new UserOperationLog(); userOperationLog.UserID = ContextUser.UserID; userOperationLog.ActionID = ActionIDDefine.Cst_Action1006; userOperationLog.FunctionID = "更新密码"; userOperationLog.CreateDate = DateTime.Now; userOperationLog.Num = 0; var sender = DataSyncManager.GetDataSender(); sender.Send(userOperationLog); } } catch (Exception ex) { this.SaveLog(ex.ToString()); ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St1006_PasswordError; return(false); } return(true); }