1.授权添加日志

This commit is contained in:
老道 2023-01-14 09:09:58 +08:00
parent a7fb0b0872
commit a340625d58
1 changed files with 4 additions and 5 deletions

View File

@ -795,6 +795,7 @@ namespace Grant.Framework
{ {
lock (sendpackObj) lock (sendpackObj)
{ {
string html = string.Empty;
if (m == null) return new WebResult() { message = server }; if (m == null) return new WebResult() { message = server };
int number = 0; int number = 0;
WebResult web = null; WebResult web = null;
@ -851,7 +852,7 @@ namespace Grant.Framework
}; };
CsharpHttpHelper.HttpResult result = http.GetHtml(item); CsharpHttpHelper.HttpResult result = http.GetHtml(item);
var html = result.Html; html = result.Html;
var reg = Regex.Match(html, "^[A-Za-z0-9]+$"); var reg = Regex.Match(html, "^[A-Za-z0-9]+$");
if (!reg.Success) if (!reg.Success)
{ {
@ -865,7 +866,7 @@ namespace Grant.Framework
web = tea.json.Deserialize<WebResult>(json_data); web = tea.json.Deserialize<WebResult>(json_data);
} }
if (!web.ok) if (!web.ok)
throw new Exception(web.message.ToString()); throw new Exception($"{web.message.ToString()}_,{html}");
return web; return web;
} }
catch (Exception ex) catch (Exception ex)
@ -877,12 +878,10 @@ namespace Grant.Framework
} }
if (!tryException) if (!tryException)
throw ex; throw new Exception($"{ex.Message}_,{html}");
} }
return null; return null;
} }
} }
public Icon Ico { get; private set; } public Icon Ico { get; private set; }
public Dictionary<string, object> About { get; private set; } public Dictionary<string, object> About { get; private set; }