Files
number_zj/20220330_Vote/Ewide.Web.Entry/Controllers/WXController.cs
2023-01-11 15:25:18 +08:00

33 lines
909 B
C#

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();
}
}
}