| | |
| | | logic.LogicName = Logicifon["LogicName"].ToString(); |
| | | logic.LogicType = int.Parse(Logicifon["LogicType"].ToString()); |
| | | logic.Relationship = int.Parse(Logicifon["Relationship"].ToString()); |
| | | logic.LogicCustomPushText =Logicifon["LogicCustomPushText"].ToString(); |
| | | logic.TimeAttribute = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.TimeAttributeObj>(Logicifon["TimeAttribute"].ToString()); |
| | | logic.Conditions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(Logicifon["Conditions"].ToString()); |
| | | logic.Accounts = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(Logicifon["Accounts"].ToString()); |
| | |
| | | return await WebClientAsync(2, lockifon.Url, lockifon); |
| | | } |
| | | |
| | | //打印NameValueCollection()显示索引, 键,值 |
| | | //打印NameValueCollection()显示索引, 键,值 |
| | | public static void PrintKeysAndValues2(NameValueCollection myCol) |
| | | { |
| | | for (int i = 0; i < myCol.Count; i++) |
| | |
| | | /// <returns></returns> |
| | | public static async System.Threading.Tasks.Task<string>Data(string command, string url, string method, object obj = null) |
| | | { |
| | | var getUrl = CommonPage.RequestHttpsHost + url;//请求地址; |
| | | var getUrl =""; |
| | | var jObject = new JObject(); |
| | | if (UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 1) |
| | | { |
| | | getUrl = CommonPage.RequestHttpsHost + url;//请求地址; |
| | | jObject.Add("IsOtherAccountCtrl", false); |
| | | jObject.Add("LoginAccessToken", Config.Instance.Token); |
| | | } |
| | | else |
| | | { |
| | | getUrl = Config.Instance.AdminRequestBaseUrl + url;//请求地址; |
| | | jObject.Add("IsOtherAccountCtrl", true); |
| | | jObject.Add("LoginAccessToken", Config.Instance.AdminRequestToken); |
| | | } |
| | | switch (command) |
| | | { |
| | | case "添加/更新": |
| | | { |
| | | jObject.Add("RequestVersion", CommonPage.RequestVersion); |
| | | jObject.Add("LoginAccessToken", Config.Instance.Token); |
| | | //jObject.Add("LoginAccessToken", Config.Instance.Token); |
| | | jObject.Add("HomeId", Config.Instance.HomeId); |
| | | jObject.Add("LogicID", Common.Logic.CurrentLogic.LogicId); |
| | | jObject.Add("PushUserIds", new JArray { Config.Instance.Guid }); |
| | | jObject.Add("PushContent", Common.Logic.CurrentLogic.LogicCustomPushText); |
| | | |
| | | } |
| | | break; |
| | | case "删除": |
| | | { |
| | | jObject.Add("RequestVersion", CommonPage.RequestVersion); |
| | | jObject.Add("LoginAccessToken", Config.Instance.Token); |
| | | //jObject.Add("LoginAccessToken", Config.Instance.Token); |
| | | jObject.Add("HomeId", Config.Instance.HomeId); |
| | | jObject.Add("LogicID", Common.Logic.CurrentLogic.LogicId); |
| | | } |