コード例 #1
0
        public JsonResult BindUser(string username, string password, string headimgurl, string serviceProvider, string openId, Model.MemberOpenIdInfo.AppIdTypeEnum appidtype = MemberOpenIdInfo.AppIdTypeEnum.Normal, string unionid = null, string sex = null, string city = null, string province = null, string country = null, string nickName = null)
        {
            var service = _iMemberService;
            var member  = service.Login(username, password);

            if (member == null)
            {
                throw new Himall.Core.HimallException("用户名和密码不匹配");
            }

            //Log.Debug("BindUser unionid=" + (string.IsNullOrWhiteSpace(unionid) ? "null" : unionid));
            headimgurl = System.Web.HttpUtility.UrlDecode(headimgurl);
            nickName   = System.Web.HttpUtility.UrlDecode(nickName);
            city       = System.Web.HttpUtility.UrlDecode(city);
            province   = System.Web.HttpUtility.UrlDecode(province);
            OAuthUserModel model = new OAuthUserModel()
            {
                AppIdType     = appidtype,
                UserId        = member.Id,
                LoginProvider = serviceProvider,
                OpenId        = openId,
                Headimgurl    = headimgurl,
                UnionId       = unionid,
                Sex           = sex,
                NickName      = nickName,
                City          = city,
                Province      = province
            };

            service.BindMember(model);

            base.SetUserLoginCookie(member.Id);
            WebHelper.SetCookie(CookieKeysCollection.HIMALL_ACTIVELOGOUT, "0", DateTime.MaxValue);
            SellerLoginIn(username, password);
            return(Json(new { success = true }));
        }
コード例 #2
0
 /// <summary>
 /// 绑定会员(增加标记,是否是可以支付的openid)
 /// </summary>
 /// <param name="userId"></param>
 /// <param name="serviceProvider"></param>
 /// <param name="openId"></param>
 /// <param name="AppidType"></param>
 /// <param name="headImage"></param>
 public static void BindMember(long userId, string serviceProvider, string openId, Model.MemberOpenIdInfo.AppIdTypeEnum AppidType, string sex = null, string headImage = null, string unionid = null)
 {
     _iMemberService.BindMember(userId, serviceProvider, openId, AppidType, sex, headImage, unionid);
 }