Esempio n. 1
0
        /// <summary>
        /// 更新插件信息
        /// </summary>
        /// <param name="model"></param>
        public static void UpdateMemberContacts(Himall.DTO.MemberContacts model)
        {
            Mapper.CreateMap <Himall.DTO.MemberContacts, Himall.Model.MemberContactsInfo>();
            var mm = Mapper.Map <Himall.DTO.MemberContacts, Himall.Model.MemberContactsInfo>(model);

            MessageApplication.UpdateMemberContacts(mm);
        }
Esempio n. 2
0
        /// <summary>
        /// 验证码验证,认证管理员
        /// </summary>
        /// <param name="pluginId">信息类别</param>
        /// <param name="code">验证码</param>
        /// <param name="destination">联系号码</param>
        /// <param name="userId">会员ID</param>
        /// <returns></returns>
        public static int CheckShopCode(string pluginId, string code, string destination, long userId)
        {
            var member    = MemberApplication.GetMembers(userId);
            int result    = 0;
            var cache     = CacheKeyCollection.MemberPluginCheck(member.UserName, pluginId + destination);
            var cacheCode = Core.Cache.Get <string>(cache);

            if (cacheCode != null && cacheCode == code)
            {
                if (MessageApplication.GetMemberContactsInfo(pluginId, destination, Entities.MemberContactInfo.UserTypes.General) != null)
                {
                    result = -1;
                }
                else
                {
                    if (pluginId.ToLower().Contains("email"))
                    {
                        member.Email = destination;
                    }
                    else if (pluginId.ToLower().Contains("sms"))
                    {
                        member.CellPhone = destination;
                    }

                    MemberApplication.UpdateMember(member);

                    MessageApplication.UpdateMemberContacts(new Entities.MemberContactInfo()
                    {
                        Contact         = destination,
                        ServiceProvider = pluginId,
                        UserId          = userId,
                        UserType        = Entities.MemberContactInfo.UserTypes.General
                    });

                    Core.Cache.Remove(CacheKeyCollection.MemberPluginCheck(member.UserName, pluginId));
                    Core.Cache.Remove(CacheKeyCollection.Member(userId));//移除用户缓存
                    Core.Cache.Remove("Rebind" + userId);
                    result = 1;
                }
            }
            return(result);
        }