Esempio n. 1
0
        void _4_Response(LxwResponse o)
        {
            var value = o.Value;

            if (value.IndexOf("pass_ticket") == -1)
            {
                throw new Exception("没有得到wxsid信息" + value);
            }

            var weixin = Xml2Json <WeiXinTicket>(value);

            //存储数据
            WEB.Add(SKEY, weixin.skey);
            WEB.Add(WXSID, weixin.wxsid);
            WEB.Add(WXUIN, weixin.wxuin);
            WEB.Add(PASS_TICKET, weixin.pass_ticket);
        }
Esempio n. 2
0
        bool _3_Response(LxwResponse o)
        {
            var result = o.Value;

            if (result.IndexOf("window.redirect_uri=") != -1)
            {
                var redirect_uri = SearchKey(result, "redirect_uri", "\"(.*?)\"");
                WEB.Add(REDIRECT_URL, redirect_uri);

                WEB.Add(NUMBER, "");
                if (redirect_uri.IndexOf("wx2.qq.com") != -1)
                {
                    WEB.Add(NUMBER, "2");
                }
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
        void _5_Response(LxwResponse o)
        {
            var login = JsonConvert.DeserializeObject <WEBWXINITRootObject>(o.Value);

            if (login.BaseResponse.Ret != 0)
            {
                throw new Exception("没有返回正确的数据,webwxinit错误!");
            }

            // USER_INFO
            LoginUser = login.User;

            WEB.Add(SYNCKEY, string.Join("|", login.SyncKey.List.Select(kv => $"{kv.Key}_{kv.Val}")));
            WEB.Add(SYNCKEY_LONG, JsonConvert.SerializeObject(login.SyncKey));

            foreach (var item in login.ContactList.Where(c => string.IsNullOrEmpty(c.KeyWord)).OrderByDescending(c => c.ContactFlag))
            {
                USER_DI.Add((item.UserName, item));
            }
        }
Esempio n. 4
0
        void _8_Response(LxwResponse o)
        {
            var value = o.Value;

            if (value.IndexOf("\"SyncKey\": ") == -1)
            {
                throw new Exception("SyncKey 没有捕获到");
            }

            var root = JsonConvert.DeserializeObject <SyncRoot>(value);

            if (root.SyncKey != null && root.SyncKey.Count != null)
            {
                WEB.Add(SYNCKEY_LONG, JsonConvert.SerializeObject(root.SyncKey));
            }
            foreach (var item in root.AddMsgList)
            {
                var content = item.Content.Replace("&gt;", ">").Replace("&lt;", "<").Replace("<br/>", "");
                //处理消息
                _9_DoMessage(content, item, item.MsgId);
            }
        }
Esempio n. 5
0
        void _1_Response(LxwResponse o)
        {
            var value = SearchKey(o.Value, "200", "\"(.*?)\"");

            WEB.Add(UUID, value);
        }