| | |
| | | /// <param name="checkAuthority">是否检测权限,该参数不能省略</param>
|
| | | /// <param name="obj">一个类</param>
|
| | | /// <param name="listNotShowError">不需要显示错误的错误类别(接口返回的错误类别),如果包含,则会返回【true】</param>
|
| | | /// <param name="setAgain">当发送失败时,是否重发,默认不重发</param>
|
| | | public static bool GetResultStatuByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
|
| | | /// <param name="setAgain">当发送失败时,是否重发,默认重发</param>
|
| | | public static bool GetResultStatuByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
|
| | | {
|
| | | if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
|
| | | {
|
| | | //当前无法访问网络(当需要重新发送时,跳过这个判断)
|
| | | ShowNotNetMsg(listNotShowError);
|
| | | return false;
|
| | | }
|
| | | //获取接口的连接模式
|
| | | var connectMode = GetHttpConnectMode(checkAuthority);
|
| | | //获取从接口那里取到的比特数据
|
| | |
| | | {
|
| | | if (setAgain == false)
|
| | | {
|
| | | //不指定重发
|
| | | //当前无法访问网络
|
| | | ShowNotNetMsg(listNotShowError);
|
| | | return false;
|
| | | }
|
| | | byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
|
| | |
| | | /// <param name="checkAuthority">是否检测权限,该参数不能省略</param>
|
| | | /// <param name="obj">一个类</param>
|
| | | /// <param name="listNotShowError">不需要显示错误的错误类别(接口返回的错误类别),如果包含,则会返回【true】</param>
|
| | | /// <param name="setAgain">当发送失败时,是否重发,默认不重发</param>
|
| | | /// <param name="setAgain">当发送失败时,是否重发,默认重发</param>
|
| | | /// </param>
|
| | | public static string GetResultCodeByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
|
| | | public static string GetResultCodeByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
|
| | | {
|
| | | if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
|
| | | {
|
| | | //当前无法访问网络(当需要重新发送时,跳过这个判断)
|
| | | ShowNotNetMsg(listNotShowError);
|
| | | return "Error";
|
| | | }
|
| | |
|
| | | //获取接口的连接模式
|
| | | var connectMode = GetHttpConnectMode(checkAuthority);
|
| | | //获取从接口那里取到的比特数据
|
| | |
| | | {
|
| | | if (setAgain == false)
|
| | | {
|
| | | //不指定重发
|
| | | //当前无法访问网络
|
| | | ShowNotNetMsg(listNotShowError);
|
| | | return "Error";
|
| | | }
|
| | | byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
|
| | |
| | | /// <param name="checkAuthority">是否检测权限,该参数不能省略</param>
|
| | | /// <param name="obj">一个类</param>
|
| | | /// <param name="listNotShowError">不需要显示错误的错误类别(接口返回的错误类别),如果包含,则会返回【true】</param>
|
| | | /// <param name="setAgain">当发送失败时,是否重发,默认不重发</param>
|
| | | /// <param name="setAgain">当发送失败时,是否重发,默认重发</param>
|
| | | /// </param>
|
| | | public static string GetResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
|
| | | public static string GetResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
|
| | | {
|
| | | if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
|
| | | {
|
| | | //当前无法访问网络(当需要重新发送时,跳过这个判断)
|
| | | ShowNotNetMsg(listNotShowError);
|
| | | return null;
|
| | | }
|
| | | //获取接口的连接模式
|
| | | var connectMode = GetHttpConnectMode(checkAuthority);
|
| | | //获取从接口那里取到的比特数据
|
| | |
| | | {
|
| | | if (setAgain == false)
|
| | | {
|
| | | //不指定重发
|
| | | //当前无法访问网络
|
| | | ShowNotNetMsg(listNotShowError);
|
| | | return null;
|
| | | }
|
| | | byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
|
| | |
| | | /// <param name="checkAuthority">是否检测权限,该参数不能省略</param>
|
| | | /// <param name="obj">一个类</param>
|
| | | /// <param name="listNotShowError">不需要显示错误的错误类别(接口返回的错误类别),如果包含,则会返回【true】</param>
|
| | | /// <param name="setAgain">当发送失败时,是否重发,默认不重发</param>
|
| | | public static byte[] GetByteResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
|
| | | /// <param name="setAgain">当发送失败时,是否重发,默认重发</param>
|
| | | public static byte[] GetByteResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
|
| | | {
|
| | | if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
|
| | | {
|
| | | //当前无法访问网络(当需要重新发送时,跳过这个判断)
|
| | | ShowNotNetMsg(listNotShowError);
|
| | | return null;
|
| | | }
|
| | | //获取接口的连接模式
|
| | | var connectMode = GetHttpConnectMode(checkAuthority);
|
| | | //获取从接口那里取到的比特数据
|
| | |
| | | {
|
| | | if (setAgain == false)
|
| | | {
|
| | | //不指定重发
|
| | | //当前无法访问网络
|
| | | ShowNotNetMsg(listNotShowError);
|
| | | return null;
|
| | | }
|
| | | revertObj = ResetByteRequestHttps(RequestName, checkAuthority, obj);
|
| | |
| | | //断开远程Mqtt连接,重新连接
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | HdlGatewayLogic.Current.ClearAllRealGateway();
|
| | | HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
|
| | | await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
|
| | | }, ShowErrorMode.NO);
|
| | | }
|
| | |
| | |
|
| | | //清空当前住宅id
|
| | | Config.Instance.HomeId = string.Empty;
|
| | | HdlGatewayLogic.Current.ClearAllRealGateway();
|
| | | HdlGatewayLogic.Current.ClearAllRealGatewayConection(false);
|
| | |
|
| | | //断开远程Mqtt连接
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | |
| | | }
|
| | | else if (view is UserView.UserPage)
|
| | | {
|
| | | var form = ((UserView.UserPage)view).GetNowActionForm();
|
| | | form?.FormActionAgainEvent();
|
| | | //刷新主页
|
| | | UserView.UserPage.Instance.ReFreshControl();
|
| | | return;
|
| | | }
|
| | | else
|
| | |
| | | //断开远程Mqtt连接,重新连接
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | HdlGatewayLogic.Current.ClearAllRealGateway();
|
| | | HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
|
| | | await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
|
| | | }, ShowErrorMode.NO);
|
| | |
|