完成主页框架

This commit is contained in:
falcon 2020-05-09 11:44:07 +08:00
parent d5c5dd3bb8
commit b8e59f524a
12 changed files with 144 additions and 12 deletions

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using FAuth.Models;
namespace FAuth.Controllers
{
/// <summary>
/// 用户控制器
/// </summary>
public class AppController:ControllerBase<AppController>
{
public AppController(ILogger<AppController> logger,IServiceProvider service) : base(logger,service) {
}
public IActionResult Index() {
return PartialView();
}
}
}

View File

@ -10,6 +10,7 @@ namespace FAuth.Controllers
/// <summary>
/// 控制器类基类
/// </summary>
//[Route("[Controller]/[Action]")]
public abstract class ControllerBase<LoggerType>:Controller
{
/// <summary>

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using FAuth.Models;
namespace FAuth.Controllers
{
/// <summary>
/// 角色
/// </summary>
public class RoleController:ControllerBase<RoleController>
{
public RoleController(ILogger<RoleController> logger,IServiceProvider service) : base(logger,service) {
}
public IActionResult Index() {
return PartialView();
}
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using FAuth.Models;
namespace FAuth.Controllers
{
/// <summary>
/// 角色组控制器
/// </summary>
public class RoleGroupController:ControllerBase<RoleGroupController>
{
public RoleGroupController(ILogger<RoleGroupController> logger,IServiceProvider service) : base(logger,service) {
}
public IActionResult Index() {
return PartialView();
}
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using FAuth.Models;
namespace FAuth.Controllers
{
/// <summary>
/// 用户控制器
/// </summary>
public class UserController:ControllerBase<UserController>
{
public UserController(ILogger<UserController> logger,IServiceProvider service) : base(logger,service) {
}
public IActionResult Index() {
return PartialView();
}
}
}

View File

@ -105,20 +105,18 @@ namespace FAuth
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseSwagger();
app.UseSwaggerUI(c => {
c.SwaggerEndpoint("/swagger/V1/swagger.json","½Ó¿ÚÎĵµ");
c.RoutePrefix = "";
c.RoutePrefix = "api";
});
app.UseAuthorization();
app.UseRouting();
app.UseEndpoints(endpoints => {
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
pattern: "{controller=Home}/{action=Index}");
});
}
}

View File

@ -0,0 +1,7 @@

@{
ViewData["Title"] = "Index";
}
<h1>AppController Index</h1>

View File

@ -1,8 +1,7 @@
@{
ViewData["Title"] = "Home Page";
ViewBag.Title = "首页";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>

View File

@ -0,0 +1,7 @@

@{
ViewData["Title"] = "Index";
}
<h1>RoleController Index</h1>

View File

@ -0,0 +1,7 @@

@{
ViewData["Title"] = "Index";
}
<h1>RoleGroupController Index</h1>

View File

@ -11,7 +11,7 @@
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">FAuth</a>
<a class="navbar-brand" asp-controller="Home" asp-action="Index">FAuth统一认证登录平台SSO</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
@ -19,10 +19,16 @@
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
<a class="nav-link text-dark" fajax-updata="main" asp-controller="App" asp-action="Index">应用管理</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
<a class="nav-link text-dark" fajax-updata="main" asp-controller="RoleGroup" asp-action="Index">角色组管理</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" fajax-updata="main" asp-controller="Role" asp-action="Index">角色管理</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" fajax-updata="main" asp-controller="User" asp-action="Index">用户管理</a>
</li>
</ul>
</div>
@ -37,7 +43,7 @@
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2020 - FAuth - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
&copy; 2020 - FAuth - <a target="_blank" href="http://39.105.71.191/Falcon/FalconSSO/issues">技术支持</a>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>

View File

@ -0,0 +1,7 @@

@{
ViewData["Title"] = "Index";
}
<h1>User Index</h1>