Seamus 4 mesi fa
parent
commit
8fd1a009c7

+ 1 - 1
ERP.Application/appsettings.Development.json

@@ -9,7 +9,7 @@
   },
   "Security": {
     "WhiteList": [
-      "/swagger/*",
+      "/swagger/**",
       "/auth/login",
       "/auth/logout"
     ]

+ 2 - 1
ERP.Core/Controller/AuthController.cs

@@ -11,6 +11,7 @@ using Swashbuckle.AspNetCore.Annotations;
 
 namespace ERP.Core.Controller
 {
+
     [Route("auth")]
     public class AuthController : BaseController
     {
@@ -34,7 +35,7 @@ namespace ERP.Core.Controller
         {
             var securityConfig = _configuration.GetSection(FrameworkConstant.SECURITY_CONFIG).Get<SecurityConfig>() ?? new SecurityConfig();
 
-            var loginUser = _authService.GetLoginUser(securityConfig, form.LoginName, form.Password);
+            var loginUser = _authService.GetLoginUser(securityConfig, form.UserName, form.Password);
 
             var result = LoginHelper.LoginByDevice(loginUser, securityConfig, DeviceEnum.Web);
 

+ 3 - 3
ERP.Core/Controller/SysUserController.cs

@@ -27,13 +27,13 @@ namespace ERP.Core.Controller
         }
 
         [HttpGet]
-        public IActionResult GetList(long Id)
+        public IActionResult GetList(long id)
         {
             return Success();
         }
 
-        [HttpGet]
-        public IActionResult GetById(long Id)
+        [HttpGet("/{id}")]
+        public IActionResult GetById(long id)
         {
             return Success();
         }

+ 1 - 1
ERP.Core/CoreDbContext.cs

@@ -55,7 +55,7 @@ namespace ERP.Core
             modelBuilder.ApplyConfigurationsFromAssembly(assembly);
 
             foreach (Type type in assembly.ExportedTypes
-                .Where(t => t.IsClass && (t.BaseType == typeof(BaseEntity) || t.BaseType == typeof(TreeEntity))))
+                .Where(t => t.IsClass && (t.BaseType == typeof(BaseEntity) || t.BaseType == typeof(TreeEntity<>))))
             {
                 modelBuilder.Model.AddEntityType(type);
             }

+ 1 - 1
ERP.Core/Dto/LoginBody.cs

@@ -6,7 +6,7 @@
         /// 账号
         /// </summary>
         //[NotEmpty]
-        public string LoginName { get; set; } = string.Empty;
+        public string UserName { get; set; } = string.Empty;
 
         /// <summary>
         /// 密码

+ 4 - 1
ERP.Framework/Resource/FrameworkI18N.cs

@@ -50,6 +50,9 @@ namespace ERP.Framework.Resource
         /// </summary>
         /// <param name="name"></param>
         /// <returns></returns>
-        public static string? GetString(string name) => _resourceManager.GetString(name);
+        public static string? GetString(string name)
+        {
+            return _resourceManager.GetString(name);
+        }
     }
 }

+ 1 - 1
ERP.Framework/WebApi/TreeEntity.cs

@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
 
 namespace ERP.Framework.WebApi
 {
-    public class TreeEntity<T> : BaseEntity
+    public class TreeEntity<T> : BaseEntity where T:class
     {
         /// <summary>
         /// 父Id