/// <summary> /// 用户登录后 持久化指令 Token /// </summary> /// <param name="command"></param> public void Execute(LoginRecordCommand command) { SysMember sysMember = memberRepository.GetById(command.Id); sysMember.SetProfile(command.Token); memberRepository.SaveChange(sysMember); command.Result = new CommandResult() { Status = true }; }
public ActionResult Login() { var rlt = _platformQuery.Login(this.RequestString("account"), this.RequestString("pwd")); if (rlt.Status) { var sysMembe = rlt.OutputData as sys_member; if (Const.RedisConfigure.Default().Switch) { //Redis.RedisHelper.Set("sys_member:" + sysMembe.account, sysMembe, Const.RedisConfigure.Default().ExpiryDate.Minutes); } var command = new LoginRecordCommand(sysMembe.ID, sysMembe.profile, 1); CommandBus.Instance.Send(command); } return(rlt); }