using Adam; using System.Collections; using System.Threading.Tasks; using UnityEngine; public class ExaminationLoad { /// /// 传入分数、等信息,返回bool值区分成功与否 /// /// /// public async Task LoadAsync(ExaminationData data) { string url = WebIPAdress.Instance.dicAdresses["分数接口"]; ExaminationRoot rr = await AsyncWebReq.Post(string.Format("{0}{1}&id_card={2}&step={3}&tip={4}&score={5}", url, data.real_name, data.id_card, data.step, data.tip, data.score), null); return rr.state; } /// /// /// /// /// public IEnumerator LoadAsyncPost(string name, string id, string obj) { //Debug.Log("loadaasync Name" + name+" aksjgdkajs "+ id); //string url = WebIPAdress.Instance.dicAdresses["断电续存"]; //url += string.Format($"?action=writebreak&real_name={name}"); //Debug.Log("=========" + url); //WWWForm wWWForm = new WWWForm(); ////wWWForm.AddField("action", "writebreak"); ////wWWForm.AddField("real_name", name); //wWWForm.AddField("id_card", id); //wWWForm.AddField("data", obj); //WWW ww = new WWW(url, wWWForm); //yield return ww; //Debug.Log("完成续存======" + ww.url); //Debug.Log(ww.text); yield return new WaitForEndOfFrame(); } public async Task GetLoad(string name, string id) { return await GetData(string.Format($"http://127.0.0.1:10013/Handler/ResultDetail.ashx?action=readbreak&real_name={name}&id_card={id}")); } private async Task GetData(string url) { Debug.Log(url); DuanDian duan = await AsyncWebReq.Get(url); if (duan.state) { Debug.Log("后台有数据"); } else { Debug.Log("后台无数据"); } Debug.Log(duan.data); return duan; } } public class ExaminationDatas { /// /// /// public string detail_id { get; set; } /// /// /// public string result_id { get; set; } /// /// /// public string tip { get; set; } /// /// /// public int step { get; set; } /// /// /// public string name { get; set; } /// /// /// public int score { get; set; } /// /// /// public string subject_id { get; set; } /// /// /// public string subject_name { get; set; } /// /// /// public string user_id { get; set; } /// /// /// public string login_name { get; set; } /// /// /// public string real_name { get; set; } /// /// /// public string grade { get; set; } /// /// /// public string major { get; set; } /// /// /// public string fault_code { get; set; } /// /// /// public string fault_name { get; set; } /// /// /// public string examine_time { get; set; } /// /// /// public string examine_kind { get; set; } /// /// /// public string examine_term { get; set; } /// /// /// public string batch_id { get; set; } /// /// /// public string batch_name { get; set; } /// /// /// public string sjms { get; set; } /// /// /// public string r1 { get; set; } /// /// /// public string r2 { get; set; } /// /// /// public string r3 { get; set; } } public class ExaminationRoot { /// /// /// public bool state; /// /// /// public string message; /// /// /// public ExaminationDatas data; } #region public class DuanDian { public bool state; public string message; public string data; } public class PostData { public string real_name; public string id_card; public string data; } #endregion