protected override object ChangePasswordByOldPassword(string oldPassword, string password) { CheckUserLogin(); if (string.IsNullOrWhiteSpace(password)) { return(ErrorResult("密码不能为空")); } if (!ShopBranchApplication.CheckManagerPassword(CurrentUser.Id, oldPassword)) { return(ErrorResult("旧密码输入不正确")); } ShopBranchApplication.SetManagerPassword(CurrentUser.Id, password); return(SuccessResult("密码修改成功")); }
protected override object ChangePassowrdByCertificate(string certificate, string password) { if (string.IsNullOrWhiteSpace(password)) { return(ErrorResult("密码不能为空")); } certificate = SecureHelper.AESDecrypt(certificate, _encryptKey); long userId = long.TryParse(certificate.Split(':')[0], out userId) ? userId : 0; if (userId == 0) { throw new HimallException("数据异常"); } ShopBranchApplication.SetManagerPassword(userId, password); return(SuccessResult("密码修改成功")); }