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>
|
|
|
|
|
[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() };
|
|
|
|
|
uriBuilder.Path += Request.Path;
|
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
|
|
|
|
}
|