You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/Infrastructure/Web/Mvc/BaseController.cs

21 lines
755 B

using Microsoft.AspNetCore.Mvc;
namespace Infrastructure.Web
{
public class BaseController : Controller
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1054:URI 参数不应为字符串", Justification = "<挂起>")]
[ApiExplorerSettings(IgnoreApi = true)]
public IActionResult RedirectTo(string action = "Index", string controller = null, string rawMesage = "操作成功", object routeValues = null, string returnUrl = null)
{
if (returnUrl is null)
{
returnUrl = Url.Action(action, controller, routeValues);
}
ViewBag.Message = rawMesage;
ViewBag.Url = returnUrl;
return View("Redirect");
}
}
}