예제 #1
0
        public static void SetUserOpenId(string userId, string openId)
        {
            string key = string.Empty;

            if (!string.IsNullOrWhiteSpace(userId))
            {
                using (var redis = new PooledRedisClientManager(Port, new string[] { Url }).GetClient())
                {
                    key = "openId" + openId;
                    redis.Set(key, userId, DateTime.Now.AddHours(16));
                    key = "userId" + userId;
                    redis.Set(key, openId, DateTime.Now.AddHours(16));
                }
            }
        }