BootstrapAdmin11/Bootstrap.Admin/Controllers/HomeController.cs

36 lines
1004 B
C#

using Bootstrap.Admin.Models;
using Bootstrap.DataAccess;
using Longbow.Web.WebSockets;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
namespace Bootstrap.Admin.Controllers
{
/// <summary>
///
/// </summary>
public class HomeController : Controller
{
/// <summary>
///
/// </summary>
/// <returns></returns>
public ActionResult Index()
{
var v = new HeaderBarModel(User.Identity) { HomeUrl = DictHelper.RetrieveHomeUrl() };
return v.HomeUrl.StartsWith("~/") ? (ActionResult)View(v) : Redirect(v.HomeUrl);
}
/// <summary>
///
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[AllowAnonymous]
public IActionResult Error(int id)
{
return id == 404 ? View("NotFound") : View();
}
}
}