Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override bool CheckLogin()
        {
            int    Act  = 4;
            string Sign = string.Format("{0}{1}{2}{3}{4}", AppId.ToNotNullString(), Act, Uin.ToNotNullString(), SessionID.ToNotNullString(), AppKey.ToNotNullString());

            Sign = HashToMD5Hex(Sign);

            string urlData = string.Format("{0}?AppId={1}&Act={2}&Uin={3}&SessionID={4}&Sign={5}",
                                           Url.ToNotNullString(),
                                           AppId.ToNotNullString(),
                                           Act,
                                           Uin.ToNotNullString(),
                                           SessionID.ToNotNullString(),
                                           Sign.ToNotNullString()
                                           );

            string result = HttpPostManager.GetStringData(urlData);

            try
            {
                if (string.IsNullOrEmpty(result))
                {
                    TraceLog.ReleaseWrite("91sdk login fail result:{0},request url:{1}", result, urlData);
                    return(false);
                }
                SDKError sdk = JsonUtils.Deserialize <SDKError>(result);
                if (sdk.ErrorCode != "1")
                {
                    TraceLog.ReleaseWrite("91sdk login fail:{0},request url:{1}", sdk.ErrorDesc, urlData);
                    return(false);
                }
                string[] arr = SnsManager.LoginByRetail(_retailID, Uin);
                this.UserID     = arr[0];
                this.PassportID = arr[1];
                return(true);
            }
            catch (Exception ex)
            {
                new BaseLog().SaveLog(ex);
                return(false);
            }

            //return !string.IsNullOrEmpty(UserID) && UserID != "0";
        }