public static ResultJson <LoginModel> Login(string username, string password) { try { string url = UrlModel.ip + UrlModel.login; RequestLoginModel requestLoginModel = new RequestLoginModel(username, password); string result = HttpUrlConfig.PostBody(url, requestLoginModel); ResultJson <LoginModel> retStu = JsonConvert.DeserializeObject <ResultJson <LoginModel> >(result); Logger.Default.Info(result); return(retStu); } catch (Exception ex) { Logger.Default.Error(ex.Message); return(null); } }
/// <summary> /// 新增检测 /// </summary> /// <param name="requestNucleic"></param> /// <returns></returns> public static ResultJson <string> addNucleic(List <InfoListModel> requestNucleic) { try { string url = UrlModel.ip + UrlModel.nucleic_add; string result = HttpUrlConfig.PostBody(url, requestNucleic); ResultJson <string> retStu = JsonConvert.DeserializeObject <ResultJson <string> >(result); Logger.Default.Info(result); return(retStu); } catch (Exception ex) { Logger.Default.Error(ex.Message); return(new ResultJson <string>() { code = "1", message = "新增失败,请稍后重试" }); } }