增加下载微信公众号文章功能
This commit is contained in:
32
20220330_Vote/Ewide.Web.Entry/Controllers/WXController.cs
Normal file
32
20220330_Vote/Ewide.Web.Entry/Controllers/WXController.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using HtmlAgilityPack;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Vote.Services.Entities;
|
||||
|
||||
namespace Ewide.Web.Entry.Controllers
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class WXController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
ViewBag.Title = "微信公众号";
|
||||
return View();
|
||||
}
|
||||
public IActionResult Result(string url)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(url))
|
||||
return Redirect("Index");
|
||||
ViewBag.Title = "微信公众号";
|
||||
var art = new Vote.Services.ApiController.WxService().GetArticle(url).Result;
|
||||
ViewBag.Title = art?.Title;
|
||||
ViewBag.Detail = art?.Detail;
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user