From 6c8e038aad394c1e91c8c046d3de25dc8e84ecbe Mon Sep 17 00:00:00 2001 From: lg <999544862qq.com> Date: 星期日, 01 九月 2024 09:31:27 +0800 Subject: [PATCH] 优化 --- WebApi/Gs.User/Service/MenuActionController.cs | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/WebApi/Gs.User/Service/MenuActionController.cs b/WebApi/Gs.User/Service/MenuActionController.cs index 035b1e4..7318af5 100644 --- a/WebApi/Gs.User/Service/MenuActionController.cs +++ b/WebApi/Gs.User/Service/MenuActionController.cs @@ -10,13 +10,19 @@ using System.Threading.Tasks; using Gs.User.Modes; using Microsoft.Extensions.Primitives; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Connections.Features; namespace Gs.User.Service { [ApiGroup(ApiGroupNames.Auth)] public class MenuActionController : IRomteService { - + private readonly IHttpContextAccessor _http; + public MenuActionController(IHttpContextAccessor httpContextAccessor) + { + _http = httpContextAccessor; + } /// <summary> /// 璇诲彇鍔熻兘鑿滃崟鍒楄〃锛屾敮鎸佸垎椤� /// </summary> @@ -25,6 +31,8 @@ [RequestMethod(RequestMethods.POST)] public ReturnDto<PageList<MenuAction>> GetListPage([FromBody] PageQuery model) { + (string userGuid, string orgGuid) = Gs.Toolbox.UtilityHelper.GetUserGuidAndOrgGuid(_http); + Gs.Toolbox.LogHelper.Debug(this.ToString(), "userGuid:" + userGuid + "锛宱rgGuid:" + orgGuid); int currentPage = model.currentPage; int everyPageSize = model.everyPageSize; string sortName = string.IsNullOrEmpty(model.sortName) ? "a.idx" : model.sortName; @@ -234,9 +242,9 @@ { if (sbSql.Length > 0) sbSql.Append(" union all"); - sbSql.Append(" select org.guid,null as upGuid,org.name,org.status,'"+ row["guid"].ToString() + "' as orgGuid from [dbo].[sys_Organization] org where org.guid ='" + row["guid"].ToString() + "'"); + sbSql.Append(" select org.guid,null as upGuid,org.name,org.status,'" + row["guid"].ToString() + "' as orgGuid from [dbo].[sys_Organization] org where org.guid ='" + row["guid"].ToString() + "'"); sbSql.Append(" union all"); - sbSql.Append(" select ma.guid,isnull(ma.upGuid,'" + row["guid"].ToString() + "') as upGuid,ma.name,ma.status,'"+ row["guid"].ToString() + "' as orgGuid from sys_MenuAction ma"); + sbSql.Append(" select ma.guid,isnull(ma.upGuid,'" + row["guid"].ToString() + "') as upGuid,ma.name,ma.status,'" + row["guid"].ToString() + "' as orgGuid from sys_MenuAction ma"); } } catch (Exception ex) -- Gitblit v1.9.3