2016-10-21 16:35:26 +08:00
|
|
|
|
using Bootstrap.Admin.Models;
|
2016-10-23 15:46:18 +08:00
|
|
|
|
using Bootstrap.DataAccess;
|
2018-06-12 13:46:06 +08:00
|
|
|
|
using Longbow.Web.WebSockets;
|
2018-06-11 12:48:11 +08:00
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
2018-06-07 00:45:47 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2018-06-12 13:46:06 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2016-10-20 17:55:29 +08:00
|
|
|
|
|
|
|
|
|
namespace Bootstrap.Admin.Controllers
|
|
|
|
|
{
|
2016-10-21 16:35:26 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2016-10-20 17:55:29 +08:00
|
|
|
|
public class HomeController : Controller
|
|
|
|
|
{
|
2016-10-21 16:35:26 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2016-10-20 17:55:29 +08:00
|
|
|
|
public ActionResult Index()
|
|
|
|
|
{
|
2018-06-07 00:45:47 +08:00
|
|
|
|
var v = new HeaderBarModel(User.Identity) { HomeUrl = DictHelper.RetrieveHomeUrl() };
|
2017-03-30 14:25:46 +08:00
|
|
|
|
return v.HomeUrl.StartsWith("~/") ? (ActionResult)View(v) : Redirect(v.HomeUrl);
|
2016-10-20 17:55:29 +08:00
|
|
|
|
}
|
2018-06-11 12:48:11 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2018-06-11 13:51:50 +08:00
|
|
|
|
/// <param name="id"></param>
|
2018-06-11 12:48:11 +08:00
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[AllowAnonymous]
|
2018-06-11 13:51:50 +08:00
|
|
|
|
public IActionResult Error(int id)
|
2018-06-11 12:48:11 +08:00
|
|
|
|
{
|
2018-06-11 13:51:50 +08:00
|
|
|
|
return id == 404 ? View("NotFound") : View();
|
2018-06-11 12:48:11 +08:00
|
|
|
|
}
|
2016-10-20 17:55:29 +08:00
|
|
|
|
}
|
|
|
|
|
}
|