2018-09-16 19:33:56 +08:00
|
|
|
|
using Bootstrap.Client.Models;
|
2018-10-10 14:49:36 +08:00
|
|
|
|
using Longbow.Configuration;
|
|
|
|
|
using Microsoft.AspNetCore.Authentication.Cookies;
|
2018-09-16 19:33:56 +08:00
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
2018-10-10 14:49:36 +08:00
|
|
|
|
using Microsoft.AspNetCore.Http;
|
2018-09-16 19:33:56 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2018-10-10 14:49:36 +08:00
|
|
|
|
using System;
|
2016-11-21 20:05:29 +08:00
|
|
|
|
|
|
|
|
|
namespace Bootstrap.Client.Controllers
|
|
|
|
|
{
|
2018-09-16 19:33:56 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2016-11-21 20:05:29 +08:00
|
|
|
|
public class HomeController : Controller
|
|
|
|
|
{
|
2018-09-16 19:33:56 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public IActionResult Index()
|
2016-11-21 20:05:29 +08:00
|
|
|
|
{
|
2018-09-16 19:33:56 +08:00
|
|
|
|
return View(new NavigatorBarModel(this));
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2018-10-25 10:00:28 +08:00
|
|
|
|
public IActionResult About()
|
|
|
|
|
{
|
2019-02-23 12:44:20 +08:00
|
|
|
|
return View(new NavigatorBarModel(this));
|
2018-10-25 10:00:28 +08:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2018-09-16 19:33:56 +08:00
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
public IActionResult Error(int id)
|
|
|
|
|
{
|
2018-10-12 18:52:28 +08:00
|
|
|
|
var uriBuilder = new UriBuilder(ConfigurationManager.AppSettings["AuthHost"]) { Query = QueryString.Create(CookieAuthenticationDefaults.ReturnUrlParameter, $"{Request.Scheme}://{Request.Host}{Request.PathBase}").ToString() };
|
2018-10-17 17:39:55 +08:00
|
|
|
|
uriBuilder.Path = uriBuilder.Path == "/" ? Request.Path.Value : uriBuilder.Path + Request.Path.Value;
|
2018-10-10 14:49:36 +08:00
|
|
|
|
return Redirect(uriBuilder.ToString());
|
2016-11-21 20:05:29 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-09-16 19:33:56 +08:00
|
|
|
|
}
|