Пример #1
0
        /// <summary>
        /// 是有效的令牌
        /// </summary>
        /// <returns></returns>
        internal static bool IsValidToken(string token)
        {
            try
            {
                if (null == token)
                {
                    return(false);
                }

                var identity = HttpCacheManager.GetCache <UserIdentity>(token);
                return(null != identity);
            }
            catch
            {
                return(false);
            }
        }
Пример #2
0
        /// <summary>
        /// 取用户令牌对应的用户标识
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        internal static UserIdentity GetIdentity(string token)
        {
            var identity = HttpCacheManager.GetCache <UserIdentity>(token);

            return(identity);
        }