示例#1
0
        private MvcContext Initialize()
        {
            this.Test = AppEnvironment.GetValueFromConfig("application:test", false);

            var userAgnet = HttpContext.Current.Request.UserAgent;

            this.Host = HttpContext.Current.Request.Url.Host;

            var anonymousAccount = AccountAuthentication.LoadAuthenticationInfo();

            if (null != anonymousAccount)
            {
                this.ClientAccount = anonymousAccount;
                this.PassportId    = anonymousAccount.PassportId;
                if (this.PassportId > 0)
                {
                    HttpContext.Current.User = new GenericPrincipal(new GenericIdentity(anonymousAccount.PassportId.ToString()), null);
                }
            }

            return(this);
        }
示例#2
0
 public void SignOut()
 {
     AccountAuthentication.SignOut();
 }