完成主页框架

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>
/// 控制器类基类 /// 控制器类基类
/// </summary> /// </summary>
//[Route("[Controller]/[Action]")]
public abstract class ControllerBase<LoggerType>:Controller public abstract class ControllerBase<LoggerType>:Controller
{ {
/// <summary> /// <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.UseHttpsRedirection();
app.UseStaticFiles(); app.UseStaticFiles();
app.UseRouting();
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(c => { app.UseSwaggerUI(c => {
c.SwaggerEndpoint("/swagger/V1/swagger.json","½Ó¿ÚÎĵµ"); c.SwaggerEndpoint("/swagger/V1/swagger.json","½Ó¿ÚÎĵµ");
c.RoutePrefix = ""; c.RoutePrefix = "api";
}); });
app.UseAuthorization(); app.UseRouting();
app.UseEndpoints(endpoints => { app.UseEndpoints(endpoints => {
endpoints.MapControllerRoute( endpoints.MapControllerRoute(
name: "default", 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"> <div class="text-center">
<h1 class="display-4">Welcome</h1> <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> </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> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container"> <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" <button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation"> aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
@ -19,10 +19,16 @@
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse"> <div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class="navbar-nav flex-grow-1"> <ul class="navbar-nav flex-grow-1">
<li class="nav-item"> <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>
<li class="nav-item"> <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> </li>
</ul> </ul>
</div> </div>
@ -37,13 +43,13 @@
<footer class="border-top footer text-muted"> <footer class="border-top footer text-muted">
<div class="container"> <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> </div>
</footer> </footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script> <script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/jquery.unobtrusive-ajax/jquery.unobtrusive-ajax.min.js"></script> <script src="~/lib/jquery.unobtrusive-ajax/jquery.unobtrusive-ajax.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script> <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script> <script src="~/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false) @RenderSection("Scripts",required: false)
</body> </body>
</html> </html>

View File

@ -0,0 +1,7 @@

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