wjc
2023-03-28 f46be160caed45c67e8980173d29ed48d525a4d3
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -197,6 +197,7 @@
                logicIfon.Add("pushConfigs", pushConfigsArray);
                logicjArray.Add(logicIfon);
                 var jObject = new JObject { { "homeId", LogicMethod.Current.HomeId }, { "logics", logicjArray } };
                string str = jObject.ToString();
                responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Add, "添加自动化", 5);
                //如果是token过期则刷新token
                if (responsePackNew.Code == StateCode.TOKEN_EXPIRED)
@@ -240,7 +241,10 @@
                    var inputTypeJOb = new JObject { };
                    inputTypeJOb.Add("sid", dictionary.sid);
                    inputTypeJOb.Add("condition_type", dictionary.condition_type);
                    if (dictionary.condition_type == "9")
                    {
                        inputTypeJOb.Add("identifier", dictionary.identifier);
                    }
                    var conditionArray = new JArray { };
                    foreach (var dic in dictionary.condition)
                    {
@@ -327,7 +331,6 @@
                logicjArray.Add(logicIfon);
                var jObject = new JObject { { "homeId", LogicMethod.Current.HomeId }, { "logics", logicjArray } };
                string str = jObject.ToString();
                responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Update, "编辑更新自动化", 5);
                //如果是token过期则刷新token
@@ -459,6 +462,38 @@
        }
        /// <summary>
        /// 获取住宅已录入人脸信息
        /// </summary>
        /// <param name="deviceId">可视对讲设备id</param>
        /// <returns></returns>
        public List<Face> GetHomeFaceList(string deviceId, bool isTip)
        {
            var jObject = new JObject();
            jObject.Add("homeId", LogicMethod.Current.HomeId);
            jObject.Add("deviceId", deviceId);
            var responsePackNew = RequestServerhomeId(jObject, NewAPI.Api_Post_GetListHomeFace, "获取住宅已录入人脸信息");
            //如果是token过期则刷新token
            if (responsePackNew.Code == StateCode.TOKEN_EXPIRED)
            {
                RefreshToken();
                GetListHomeFace(deviceId, isTip);
            }
            if (Check(responsePackNew, isTip) == false)
            {
                return new List<Face>();
            }
            var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Face>>(responsePackNew.Data.ToString());
            if (list == null)
            {
                list = new List<Face>();
            }
            faceList.Clear();
            faceList.AddRange(list);
            return list;
        }
        /// <summary>
        ///请求服务器(与住宅有关:例如;homeId) 
        /// </summary>