Beispiel #1
0
 public WyxClient(string uri, WyxWebArgs getArgs = null, WyxWebArgs postArgs = null)
     : base(uri, getArgs, postArgs)
 {
     this._baseUri      = GetApiJsonUrl(uri);
     this._session      = WyxSessionProvider.Instance.LoadWyxSession();
     this.NoSesssionKey = false;
     this.Timeout       = 3000;
 }
Beispiel #2
0
        public override IPlatSessionData InitSession(string colUid, params string[] colArgs)
        {
            var session = new WyxSessionInfo();

            PlatSessionUtil.InitSession(session, WyxSessionInfo.COLUid, WyxSessionInfo.ALLKeys);
            session.FromCollection(HttpContext.Current.Request.QueryString, false, WyxSessionInfo.ALLKeys);
            return(session);
        }
Beispiel #3
0
        bool CheckSignature(WyxSessionInfo data, string secret)
        {
            if (string.IsNullOrEmpty(data.Signature))
            {
                return(false);
            }
            var    signDic = data.ToCollection(true, WyxSessionInfo.SIGNKeys);
            string baseStr = WebUtil.BuildEscapeDataString(signDic);

            signDic.Clear();
            return(string.Compare(data.Signature, CryptoUtil.GetSHA1(baseStr + secret, "x2"), true) == 0);
        }
Beispiel #4
0
 public static string Login(out WyxSessionInfo loginInfo)
 {
     loginInfo = WyxSessionProvider.Instance.LoginSession("") as WyxSessionInfo;
     return(loginInfo.ErrorCode ?? WebErrorCode.MissWyxSession);
 }