|
|
@@ -269,29 +269,29 @@ namespace Learun.Application.Web.Controllers |
|
|
|
}.ToJson()); |
|
|
|
} |
|
|
|
|
|
|
|
public ActionResult CrawlerHandler() |
|
|
|
{ |
|
|
|
string[] sources = Request.Form.GetValues("source[]"); |
|
|
|
if (sources == null || sources.Length == 0) |
|
|
|
{ |
|
|
|
return Content(new |
|
|
|
{ |
|
|
|
state = "参数错误:没有指定抓取源" |
|
|
|
}.ToJson()); |
|
|
|
} |
|
|
|
//public ActionResult CrawlerHandler() |
|
|
|
//{ |
|
|
|
// string[] sources = Request.Form.GetValues("source[]"); |
|
|
|
// if (sources == null || sources.Length == 0) |
|
|
|
// { |
|
|
|
// return Content(new |
|
|
|
// { |
|
|
|
// state = "参数错误:没有指定抓取源" |
|
|
|
// }.ToJson()); |
|
|
|
// } |
|
|
|
|
|
|
|
UeditorCrawler[] crawlers = sources.Select(x => new UeditorCrawler(x).Fetch()).ToArray(); |
|
|
|
return Content(new |
|
|
|
{ |
|
|
|
state = "SUCCESS", |
|
|
|
list = crawlers.Select(x => new |
|
|
|
{ |
|
|
|
state = x.State, |
|
|
|
source = x.SourceUrl, |
|
|
|
url = x.ServerUrl |
|
|
|
}) |
|
|
|
}.ToJson()); |
|
|
|
} |
|
|
|
// UeditorCrawler[] crawlers = sources.Select(x => new UeditorCrawler(x).Fetch()).ToArray(); |
|
|
|
// return Content(new |
|
|
|
// { |
|
|
|
// state = "SUCCESS", |
|
|
|
// list = crawlers.Select(x => new |
|
|
|
// { |
|
|
|
// state = x.State, |
|
|
|
// source = x.SourceUrl, |
|
|
|
// url = x.ServerUrl |
|
|
|
// }) |
|
|
|
// }.ToJson()); |
|
|
|
//} |
|
|
|
private string GetStateMessage(UeditorUploadState state) |
|
|
|
{ |
|
|
|
switch (state) |
|
|
|