Beispiel #1
0
        public string Register(RegisterAct act)
        {
            var identity = new ClaimsIdentity("JWT");

            identity.AddClaim(new Claim(Bing.Runtimes.Security.BingClaimTypes.UserId, Id.ObjectId()));
            identity.AddClaim(new Claim(Bing.Runtimes.Security.BingClaimTypes.UserName, "123456"));

            Bing.Runtimes.Sessions.DefaultPrincipalAccessor.Instance.Principal.AddIdentity(identity);
            var result = _loginService.Register(act);

            return(result.ToString());
        }
Beispiel #2
0
        public void TestException(RegisterAct act)
        {
            Login entity = new Login(Guid.NewGuid());

            entity.LoginName = act.LoginName;
            entity.Name      = act.UserName;
            entity.Mobile    = act.Mobile;
            entity.PassWord  = act.Password;
            entity.Note      = "测试";
            entity.Status    = 0;

            this._loginRepository.Add(entity);
            //throw new NotImplementedException();
        }
Beispiel #3
0
        public Guid Register(RegisterAct act)
        {
            Login entity = new Login(Guid.NewGuid());

            entity.LoginName = act.LoginName;
            entity.Name      = act.UserName;
            entity.Mobile    = act.Mobile;
            entity.PassWord  = act.Password;
            entity.Note      = "测试";
            entity.Status    = 0;

            this._loginRepository.Add(entity);
            TestException(act);

            return(entity.Id);
            //this._unitOfWork.Commit();
        }