diff --git a/FAuth/Controllers/AppController.cs b/FAuth/Controllers/AppController.cs new file mode 100644 index 0000000..a53bd58 --- /dev/null +++ b/FAuth/Controllers/AppController.cs @@ -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 +{ + /// + /// 用户控制器 + /// + public class AppController:ControllerBase + { + public AppController(ILogger logger,IServiceProvider service) : base(logger,service) { + } + + public IActionResult Index() { + return PartialView(); + } + + } +} diff --git a/FAuth/Controllers/ControllerBase.cs b/FAuth/Controllers/ControllerBase.cs index 97cee89..e29dc03 100644 --- a/FAuth/Controllers/ControllerBase.cs +++ b/FAuth/Controllers/ControllerBase.cs @@ -10,6 +10,7 @@ namespace FAuth.Controllers /// /// 控制器类基类 /// + //[Route("[Controller]/[Action]")] public abstract class ControllerBase:Controller { /// diff --git a/FAuth/Controllers/RoleController.cs b/FAuth/Controllers/RoleController.cs new file mode 100644 index 0000000..b59879e --- /dev/null +++ b/FAuth/Controllers/RoleController.cs @@ -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 +{ + /// + /// 角色 + /// + public class RoleController:ControllerBase + { + public RoleController(ILogger logger,IServiceProvider service) : base(logger,service) { + } + + public IActionResult Index() { + return PartialView(); + } + + } +} diff --git a/FAuth/Controllers/RoleGroupController.cs b/FAuth/Controllers/RoleGroupController.cs new file mode 100644 index 0000000..ef8e5b3 --- /dev/null +++ b/FAuth/Controllers/RoleGroupController.cs @@ -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 +{ + /// + /// 角色组控制器 + /// + public class RoleGroupController:ControllerBase + { + public RoleGroupController(ILogger logger,IServiceProvider service) : base(logger,service) { + } + + public IActionResult Index() { + return PartialView(); + } + + } +} diff --git a/FAuth/Controllers/UserController.cs b/FAuth/Controllers/UserController.cs new file mode 100644 index 0000000..ab2e9cc --- /dev/null +++ b/FAuth/Controllers/UserController.cs @@ -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 +{ + /// + /// 用户控制器 + /// + public class UserController:ControllerBase + { + public UserController(ILogger logger,IServiceProvider service) : base(logger,service) { + } + + public IActionResult Index() { + return PartialView(); + } + + } +} diff --git a/FAuth/Startup.cs b/FAuth/Startup.cs index f6ea336..0ac8944 100644 --- a/FAuth/Startup.cs +++ b/FAuth/Startup.cs @@ -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}"); }); } } diff --git a/FAuth/Views/App/Index.cshtml b/FAuth/Views/App/Index.cshtml new file mode 100644 index 0000000..88c424d --- /dev/null +++ b/FAuth/Views/App/Index.cshtml @@ -0,0 +1,7 @@ + +@{ + ViewData["Title"] = "Index"; +} + +AppController Index + diff --git a/FAuth/Views/Home/Index.cshtml b/FAuth/Views/Home/Index.cshtml index 08a5a5c..640d685 100644 --- a/FAuth/Views/Home/Index.cshtml +++ b/FAuth/Views/Home/Index.cshtml @@ -1,8 +1,7 @@ @{ - ViewData["Title"] = "Home Page"; + ViewBag.Title = "首页"; } Welcome - Learn about building Web apps with ASP.NET Core. diff --git a/FAuth/Views/Role/Index.cshtml b/FAuth/Views/Role/Index.cshtml new file mode 100644 index 0000000..392ebb0 --- /dev/null +++ b/FAuth/Views/Role/Index.cshtml @@ -0,0 +1,7 @@ + +@{ + ViewData["Title"] = "Index"; +} + +RoleController Index + diff --git a/FAuth/Views/RoleGroup/Index.cshtml b/FAuth/Views/RoleGroup/Index.cshtml new file mode 100644 index 0000000..53a1d85 --- /dev/null +++ b/FAuth/Views/RoleGroup/Index.cshtml @@ -0,0 +1,7 @@ + +@{ + ViewData["Title"] = "Index"; +} + +RoleGroupController Index + diff --git a/FAuth/Views/Shared/_Layout.cshtml b/FAuth/Views/Shared/_Layout.cshtml index 297dd94..0f19801 100644 --- a/FAuth/Views/Shared/_Layout.cshtml +++ b/FAuth/Views/Shared/_Layout.cshtml @@ -11,7 +11,7 @@ - FAuth + FAuth统一认证登录平台(SSO) @@ -19,10 +19,16 @@ - Home + 应用管理 - Privacy + 角色组管理 + + + 角色管理 + + + 用户管理 @@ -37,13 +43,13 @@ - @RenderSection("Scripts", required: false) + @RenderSection("Scripts",required: false)
Learn about building Web apps with ASP.NET Core.