|  | @@ -7,6 +7,7 @@ using OASystem.API.OAMethodLib;
 | 
	
		
			
				|  |  |  using Serilog.Parsing;
 | 
	
		
			
				|  |  |  using OASystem.Domain.Dtos.System;
 | 
	
		
			
				|  |  |  using System.Drawing.Drawing2D;
 | 
	
		
			
				|  |  | +using System.Collections;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  namespace OASystem.API.Controllers
 | 
	
		
			
				|  |  |  {
 | 
	
	
		
			
				|  | @@ -19,14 +20,16 @@ namespace OASystem.API.Controllers
 | 
	
		
			
				|  |  |          private readonly IMapper _mapper;
 | 
	
		
			
				|  |  |          private readonly IConfiguration _config;
 | 
	
		
			
				|  |  |          private readonly LoginRepository _loginRep;
 | 
	
		
			
				|  |  | -        private readonly MessageRepository _message; 
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        public AuthController(IConfiguration config, LoginRepository loginRep, IMapper mapper,MessageRepository message)
 | 
	
		
			
				|  |  | +        private readonly MessageRepository _message;
 | 
	
		
			
				|  |  | +        private readonly SystemMenuPermissionRepository _SystemMenuPermissionRepository;
 | 
	
		
			
				|  |  | +        public AuthController(IConfiguration config, LoginRepository loginRep, IMapper mapper,MessageRepository message,
 | 
	
		
			
				|  |  | +            SystemMenuPermissionRepository systemMenuPermissionRepository)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              _config = config;
 | 
	
		
			
				|  |  |              _loginRep = loginRep;
 | 
	
		
			
				|  |  |              _mapper = mapper;
 | 
	
		
			
				|  |  |              _message = message;
 | 
	
		
			
				|  |  | +            _SystemMenuPermissionRepository = systemMenuPermissionRepository;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          /// <summary>
 | 
	
	
		
			
				|  | @@ -44,22 +47,23 @@ namespace OASystem.API.Controllers
 | 
	
		
			
				|  |  |              if (userData.Code != 0)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  if (userData.Code != 0) { return Ok(JsonView(false, userData.Msg)); }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                  return Ok(JsonView(false, "暂无该员工信息!"));
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              #endregion
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            dynamic authData = null;
 | 
	
		
			
				|  |  | +            IActionResult authData = null;
 | 
	
		
			
				|  |  | +            if (userData.Data != null)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                var uid = (userData.Data as UserLoginInfoView).UserId;
 | 
	
		
			
				|  |  | +                authData = await MenuLoad(new MenuLoadDto() { PortType = dto.PortType, UserId = uid });
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              var view = new LoginView
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                UserInfo = userData.Data,
 | 
	
		
			
				|  |  | -                AuthData = authData,
 | 
	
		
			
				|  |  | +                UserInfo = userData == null ? null : userData.Data,
 | 
	
		
			
				|  |  | +                AuthData = authData != null ? (authData as OkObjectResult).Value : null,
 | 
	
		
			
				|  |  |              };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              DateTime createZebraTime = DateTime.Now;
 | 
	
		
			
				|  |  |              string authorId = dto.Number + "Token";
 | 
	
		
			
				|  |  |              string authorToken = await RedisRepository.RedisFactory.CreateRedisRepository().StringGetAsync<string>(authorId);//string 取
 | 
	
	
		
			
				|  | @@ -181,9 +185,66 @@ namespace OASystem.API.Controllers
 | 
	
		
			
				|  |  |              return Ok(JsonView(view));
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -       
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        /// <summary>
 | 
	
		
			
				|  |  | +        /// 菜单加载
 | 
	
		
			
				|  |  | +        /// </summary>
 | 
	
		
			
				|  |  | +        /// <returns></returns>
 | 
	
		
			
				|  |  | +        [HttpPost]
 | 
	
		
			
				|  |  | +        [HttpPost("MenuLoad")]
 | 
	
		
			
				|  |  | +        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
 | 
	
		
			
				|  |  | +        public async Task<IActionResult> MenuLoad(MenuLoadDto dto)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            var QueryResult = _SystemMenuPermissionRepository.QueryMenuLoad(dto.UserId,dto.PortType);
 | 
	
		
			
				|  |  | +            ArrayList arr = new ArrayList();
 | 
	
		
			
				|  |  | +            JsonView ViewData = new JsonView();
 | 
	
		
			
				|  |  | +            ViewData.Code = 400;
 | 
	
		
			
				|  |  | +            ViewData.Msg = "错误!";
 | 
	
		
			
				|  |  | +            ViewData.Data = null;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            if (QueryResult.Code == 0)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                if (dto.PortType == 1)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    var menuGroup = (QueryResult.Data as List<MenuLoadView>).GroupBy(x => x.modulid);
 | 
	
		
			
				|  |  | +                    foreach (var item in menuGroup)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        var modul = item.FirstOrDefault();
 | 
	
		
			
				|  |  | +                        if (modul != null)
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            arr.Add(new
 | 
	
		
			
				|  |  | +                            {
 | 
	
		
			
				|  |  | +                                modulName = modul.modulName,
 | 
	
		
			
				|  |  | +                                modulid = modul.modulid,
 | 
	
		
			
				|  |  | +                                pageList = item
 | 
	
		
			
				|  |  | +                            });
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                    ViewData.Code = 200;
 | 
	
		
			
				|  |  | +                    ViewData.Msg = QueryResult.Msg;
 | 
	
		
			
				|  |  | +                    ViewData.Data = arr;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                else if (dto.PortType == 2)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    var pages = (QueryResult.Data as List<MenuLoadView>).Select(x => x.pageid).ToArray();
 | 
	
		
			
				|  |  | +                    arr = ArrayList.Adapter(pages);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                    ViewData.Code = 200;
 | 
	
		
			
				|  |  | +                    ViewData.Msg = QueryResult.Msg;
 | 
	
		
			
				|  |  | +                    ViewData.Data = arr;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            else
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                ViewData.Msg = "错误!(" + QueryResult.Msg + ")";
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            return Ok(ViewData);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  }
 |