陈嘉乐
2020-07-10 48ba446936b51fffafa7c3600c0dadc6ac0e8c20
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
@@ -873,8 +873,18 @@
                    //服务返回来没有门锁成员信息,没有必要再去请求成员列表,
                    //原因:节约时间,体验效果好;
                    result = await UserCenter.UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
                }
                if (string.IsNullOrEmpty(result))
                {
                    //防止为空抛异常;
                    return userlist;
                }
                var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UserCenter.MemberInfoRes>>(result);
                var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UserCenter.MemberInfoRes>>(result);
                if (listInfo == null)
                {
                    //防止为空抛异常;
                    return userlist;
                }
                for (int i = 0; i < listInfo.Count; i++)
                {
@@ -1226,12 +1236,16 @@
        /// <param name="method">请求方式为POST/GET</param>
        /// <param name="second">超时时间</param>
        /// <returns></returns>
        public static async System.Threading.Tasks.Task<string> HttpWebRequest(string getUrl, string str, string method, int second = 3)
        public static async System.Threading.Tasks.Task<string> HttpWebRequest(string getUrl, string str, string method, int second = 3, bool _bool = false)
        {
            HttpWebRequest request = WebRequest.Create(getUrl) as HttpWebRequest; //创建请求
            request.Method = method; //请求方式为POST/GET
            request.ContentType = "application/json";
            request.ContentType = "application/json";
            request.Timeout = second * 1000;//超时时间
            if (_bool) {
                //用于高胜可视对讲接口
                request.Headers.Add("Authorization", Config.Instance.Token);
            }
            if (method == "POST")
            {
                byte[] jsonbyte = System.Text.Encoding.UTF8.GetBytes(str);
@@ -1350,6 +1364,6 @@
            deviceConditionsInfo.Add(Key, Value);
        }
    }
}