李昊 4 years ago
parent
commit
cd2fe51d02

+ 5 - 12
gx_api/GxPress/Api/GxPress.Api/AdminControllers/AdminController.cs

@@ -10,6 +10,7 @@ using GxPress.Request.Admin;
 using GxPress.Result.Admin;
 using GxPress.Service.Interface.Role;
 using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;
@@ -29,8 +30,8 @@ namespace GxPress.Api.AdminControllers
         private readonly IAdminRepository _adminRepository;
 
         private readonly IRoleService roleService;
-
-        public AdminController(IOptions<JwtOptions> jwtOptions, ILogger<AdminController> logger, IAdminRepository adminRepository, IRoleService roleService)
+        private readonly IHttpContextAccessor httpContextAccessor;
+        public AdminController(IOptions<JwtOptions> jwtOptions, ILogger<AdminController> logger, IAdminRepository adminRepository, IRoleService roleService, IHttpContextAccessor httpContextAccessor)
         {
             _jwtOptions = jwtOptions.Value;
             _logger = logger;
@@ -47,6 +48,7 @@ namespace GxPress.Api.AdminControllers
         [AllowAnonymous]
         public async Task<AdminSignInResult> SignIn(AdminSignInRequest request)
         {
+            request.Ip = httpContextAccessor.HttpContext.Connection.LocalIpAddress.ToString();
             var result = await _adminRepository.SignInAsync(request);
             //获取菜单
             result.MenuInResult = await roleService.GetMenusAllAsync(result.RoleId);
@@ -105,16 +107,7 @@ namespace GxPress.Api.AdminControllers
         {
             return await _adminRepository.UpdateAsync(id, request);
         }
-        /// <summary>
-        /// 修改
-        /// </summary>
-        /// <param name="request"></param>
-        /// <returns></returns>
-        [HttpPut("updatemenu")]
-        public async Task<bool> UpdateMenu([FromBody] Admin request)
-        {
-            return await _adminRepository.UpdateQAsync(request);
-        }
+       
         /// <summary>
         /// 分页列表
         /// </summary>

+ 6 - 0
gx_api/GxPress/Model/GxPress.Entity/tede2/Media/MediaLibrary.cs

@@ -35,5 +35,11 @@ namespace GxPress.Entity.tede2.Media
         /// <value></value>
         [DataColumn]
         public string SectionName { get; set; }
+        /// <summary>
+        /// 类型 1 file 2 audio
+        /// </summary>
+        /// <value></value>
+        [DataColumn]
+        public int TypeId { get; set; }
     }
 }