http get ? bug

This commit is contained in:
路 范
2022-03-14 00:57:12 +08:00
parent a35cfa0819
commit 7286172aaf
24 changed files with 484 additions and 15 deletions

View File

@@ -58,11 +58,12 @@ namespace TempTask.WebEntry.Tools
///
/// </summary>
/// <param name="url"></param>
/// <param name="param"></param>
/// <returns></returns>
public static string CallUrl(string url)
public static string CallUrl(string url, string param)
{
WebClient webClient = new WebClient();
return webClient.DownloadString(url);
return webClient.DownloadString(url + (url.Contains("?") ? "&" : "?") + param);
}
}
}

View File

@@ -75,7 +75,7 @@ namespace TempTask.WebEntry.Tools
//{
// sheet = workbook.GetSheet(sheet_name.Value);
//}
var api_result = HttpHelper.CallUrl($"{sheet_item.url}?months={year}{_month}&w={week}");
var api_result = HttpHelper.CallUrl(sheet_item.url, $"months={year}{_month}&w={week}");
var obj = JObject.Parse(api_result);
var datas = obj["data"] as JArray;
//从第几行开始 , 比如 行号是4 , 就写3