优化切题接口调用提示
This commit is contained in:
parent
f08a432dc3
commit
770ecd9c76
|
|
@ -76,7 +76,7 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
|
||||||
long subjective = Convert.ToInt64(Globals.Request("subjective"));
|
long subjective = Convert.ToInt64(Globals.Request("subjective"));
|
||||||
|
|
||||||
var checkResult = CheckStatusByApi(subjective);
|
var checkResult = CheckStatusByApi(subjective);
|
||||||
if (!checkResult.data)
|
if (!checkResult.data.Value)
|
||||||
{
|
{
|
||||||
Response.Write("验证失败!" + checkResult.message);
|
Response.Write("验证失败!" + checkResult.message);
|
||||||
return;
|
return;
|
||||||
|
|
@ -188,7 +188,11 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
|
||||||
//调用接口
|
//调用接口
|
||||||
//result r = (result)JsonConvert.DeserializeObject(RequestPost(subjective.ToString(), lt.ToJsonString()), typeof(result));
|
//result r = (result)JsonConvert.DeserializeObject(RequestPost(subjective.ToString(), lt.ToJsonString()), typeof(result));
|
||||||
var r = JsonConvert.DeserializeObject<result>(RequestPost(subjective.ToString(), JsonConvert.SerializeObject(lt)));
|
var r = JsonConvert.DeserializeObject<result>(RequestPost(subjective.ToString(), JsonConvert.SerializeObject(lt)));
|
||||||
if (r.code == "200" && r.data)
|
if (r == null || r.code != "200")
|
||||||
|
{
|
||||||
|
throw new Exception("调用接口失败了!");
|
||||||
|
}
|
||||||
|
if (r.code == "200" && r.data.Value)
|
||||||
{
|
{
|
||||||
Response.Write("1");
|
Response.Write("1");
|
||||||
}
|
}
|
||||||
|
|
@ -409,7 +413,7 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
|
||||||
if (Request.Url.Host.ToLower().Contains("w.23544.com"))
|
if (Request.Url.Host.ToLower().Contains("w.23544.com"))
|
||||||
{
|
{
|
||||||
// 测试地址
|
// 测试地址
|
||||||
url = "http://mka.w.23544.com:8880/";
|
url = "https://mka.w.23544.com:8843/";
|
||||||
bearer = token;
|
bearer = token;
|
||||||
}
|
}
|
||||||
else if (Request.Url.Host.ToLower().Contains("23544.com"))
|
else if (Request.Url.Host.ToLower().Contains("23544.com"))
|
||||||
|
|
@ -441,7 +445,12 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
|
||||||
}
|
}
|
||||||
|
|
||||||
//return (result)JsonConvert.DeserializeObject(reponse.Html, typeof(result));
|
//return (result)JsonConvert.DeserializeObject(reponse.Html, typeof(result));
|
||||||
return JsonConvert.DeserializeObject<result>(reponse.Html);
|
var ress = JsonConvert.DeserializeObject<result>(reponse.Html);
|
||||||
|
if (ress == null || ress.code != "200")
|
||||||
|
{
|
||||||
|
throw new Exception("验证接口调用失败!" + Response.StatusCode + " ||| " + reponse.Html);
|
||||||
|
}
|
||||||
|
return ress;
|
||||||
}
|
}
|
||||||
private string RequestPost(string id, string body)
|
private string RequestPost(string id, string body)
|
||||||
{
|
{
|
||||||
|
|
@ -451,7 +460,7 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
|
||||||
if (Request.Url.Host.ToLower().Contains("w.23544.com"))
|
if (Request.Url.Host.ToLower().Contains("w.23544.com"))
|
||||||
{
|
{
|
||||||
// 测试地址
|
// 测试地址
|
||||||
url = "http://mka.w.23544.com:8880/";
|
url = "https://mka.w.23544.com:8843/";
|
||||||
bearer = token;
|
bearer = token;
|
||||||
}
|
}
|
||||||
else if (Request.Url.Host.ToLower().Contains("23544.com"))
|
else if (Request.Url.Host.ToLower().Contains("23544.com"))
|
||||||
|
|
@ -510,7 +519,7 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
|
||||||
public string message { get; set; }
|
public string message { get; set; }
|
||||||
public string code { get; set; }
|
public string code { get; set; }
|
||||||
|
|
||||||
public bool data { get; set; }
|
public bool? data { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue