ibms-dome/Frontend/Controllers/HomeController.cs

45 lines
1.2 KiB
C#
Raw Normal View History

2022-10-14 16:08:54 +08:00
using Frontend.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
namespace Frontend.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
private IConfiguration _configuration;
public HomeController(ILogger<HomeController> logger,
IConfiguration configuration)
{
_logger = logger;
this._configuration = configuration;
}
public IActionResult Index()
{
ViewBag.BaseApiUrl = _configuration.GetValue<string>("FrontendWebApi");
return View();
}
public IActionResult Privacy()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}