Esempio n. 1
0
        public JsonResult Skip(string serviceProvider, string openId, string nickName, string realName, string headimgurl, Entities.MemberOpenIdInfo.AppIdTypeEnum appidtype = Entities.MemberOpenIdInfo.AppIdTypeEnum.Normal, string unionid = null, string sex = null, string city = null, string province = null)
        {
            int    num      = 0;
            string username = DateTime.Now.ToString("yyMMddHHmmssffffff");   //TODO:DZY[150916]未使用,在方法内会重新生成

            nickName   = System.Web.HttpUtility.UrlDecode(nickName);
            realName   = System.Web.HttpUtility.UrlDecode(realName);
            headimgurl = System.Web.HttpUtility.UrlDecode(headimgurl);
            province   = System.Web.HttpUtility.UrlDecode(province);
            city       = System.Web.HttpUtility.UrlDecode(city);
            Entities.MemberInfo memberInfo = _iMemberService.GetMemberByUnionIdOpenId(unionid, openId);
            if (memberInfo == null)
            {
                memberInfo = _iMemberService.QuickRegister(username, realName, nickName, serviceProvider, openId, PlatformType.GetHashCode(),
                                                           unionid, sex, headimgurl, appidtype, null, city, province, spreadId: CurrentSpreadId);
                //TODO:ZJT  在用户注册的时候,检查此用户是否存在OpenId是否存在红包,存在则添加到用户预存款里
                _iBonusService.DepositToRegister(memberInfo.Id);
                //用户注册的时候,检查是否开启注册领取优惠券活动,存在自动添加到用户预存款里
                if (memberInfo.IsNewAccount)
                {
                    num = CouponApplication.RegisterSendCoupon(memberInfo.Id, memberInfo.UserName);
                }
                ClearDistributionSpreadCookie();
                _iMemberService.AddIntegel(memberInfo); //给用户加积分//执行登录后初始化相关操作
            }

            base.SetUserLoginCookie(memberInfo.Id);
            Application.MemberApplication.UpdateLastLoginDate(memberInfo.Id);
            WebHelper.SetCookie(CookieKeysCollection.HIMALL_ACTIVELOGOUT, "0", DateTime.MaxValue);

            #region 判断是否强制绑定手机号
            MemberApplication.UpdateLastLoginDate(memberInfo.Id);
            var isBind = MessageApplication.IsOpenBindSms(memberInfo.Id);
            if (!isBind)
            {
                return(Json <dynamic>(success: false, data: new { num = num }, code: 99));
            }
            #endregion

            return(Json <dynamic>(success: true, data: new { num = num }));
        }