Example #1
0
        protected bool IsLogined(HttpContext httpContext)
        {
            var strjson = httpContext.Request.Query["session"];

            if (string.IsNullOrEmpty(strjson))
            {
                return(false);
            }
            else
            {
                var result = _encryptionService.CommonDecrypt(strjson);

                if (!string.IsNullOrEmpty(result))
                {
                    var arr = result.Split("-");
                    if (arr.Length == 3)
                    {
                        httpContext.Session.SetString("userName", arr[0]);
                        httpContext.Session.SetString("ctoken", strjson);
                        // var sresult =  _adminUserInfoService.GetUserInfo(arr[0]);
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
        }