Beispiel #1
0
        /// <summary>
        /// 登入
        /// </summary>
        protected virtual void Login(RegisterModel model)
        {
            if (Identity != null)
            {
                Ioc.Resolve <IIdentityApplicationService>().Remove();
            }
            var info = new Domain.Entities.Utility.LoginEntity
            {
                Name     = model.Mobile,
                Password = model.Password
            };

            Ioc.Resolve <ILoginApplicationService>().Login(info);
            var rev = model.Errors == null || model.Errors.Count == 0;

            if (rev)
            {
                var identity = info.Identity;
                var token    = Ioc.Resolve <IIdentityApplicationService>().Set(identity);
                this.AddLoginLog(identity, "Account", "");
            }
        }
Beispiel #2
0
        protected override void Save()
        {
            if (!txtPassword.Value.Equals(txtSurePassword.Value))
            {
                this.ShowMessage("验证错误", "两次输入密码不一致");
                return;
            }
            if (string.IsNullOrEmpty(txtOriginPassword.Value))
            {
                this.ShowMessage("验证错误", "原始密码错误");
                return;
            }
            var login = new Domain.Entities.Utility.LoginEntity {
                Name = Identity.Name, Password = txtOriginPassword.Value
            };
            var info = Ioc.Resolve <ILoginApplicationService>().Login(login);

            if (info == null || info.Errors != null && info.Errors.Count > 0)
            {
                this.ShowMessage("验证错误", "原始密码错误");
                return;
            }
            base.Save();
        }