Compare commits
	
		
			No commits in common. "afc11ea2689e89b21a6ef5d0fdf7d11dc5cb62bd" and "df24bf4e9b4c8330cb6d9072e8709c1358bc6d87" have entirely different histories.
		
	
	
		
			afc11ea268
			...
			df24bf4e9b
		
	
		
@ -34,8 +34,8 @@ namespace APT.WebApi.Models
 | 
			
		||||
        /// <param name="context"></param>
 | 
			
		||||
        public override void OnActionExecuting(ActionExecutingContext context)
 | 
			
		||||
        {
 | 
			
		||||
            //context.HttpContext.Items.Add("1", System.DateTime.Now);
 | 
			
		||||
            //context.HttpContext.Items.Add("2", context.HttpContext.TraceIdentifier);
 | 
			
		||||
            context.HttpContext.Items.Add("1", System.DateTime.Now);
 | 
			
		||||
            context.HttpContext.Items.Add("2", context.HttpContext.TraceIdentifier);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
@ -46,7 +46,6 @@ namespace APT.WebApi.Models
 | 
			
		||||
        {
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                /*
 | 
			
		||||
                if (context.HttpContext.Items != null && context.HttpContext.Items.ContainsKey("1"))
 | 
			
		||||
                {
 | 
			
		||||
                    DateTime START_TIME = DateTime.Now;
 | 
			
		||||
@ -121,7 +120,7 @@ namespace APT.WebApi.Models
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }*/
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            catch
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
@ -145,10 +145,8 @@ namespace APT.NW.WebApi.Controllers.Api
 | 
			
		||||
            var commonService = APT.Infrastructure.Api.ServiceLocator.Instance.GetService<ICommonService>();
 | 
			
		||||
            if (string.IsNullOrEmpty(request.UserName.Trim()))
 | 
			
		||||
                return null;
 | 
			
		||||
            var userName = request.UserName.ToUpper();
 | 
			
		||||
            var pwd = request.Password.ToUpper();
 | 
			
		||||
            var loginUser = commonService.GetEntity<T_FM_USER>(i => (i.CODE == userName
 | 
			
		||||
                || i.PHONE == request.UserName) && i.PASSWORD.ToUpper() == pwd);
 | 
			
		||||
            var loginUser = commonService.GetEntity<T_FM_USER>(i => (i.CODE.ToUpper() == request.UserName.ToUpper()
 | 
			
		||||
                || i.PHONE == request.UserName) && i.PASSWORD.ToUpper() == request.Password.ToUpper());
 | 
			
		||||
 | 
			
		||||
            return loginUser;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -210,19 +210,70 @@ namespace APT.PF.WebApiControllers.Api.PF
 | 
			
		||||
                    {
 | 
			
		||||
                        throw new Exception("参数为空,请重试!");
 | 
			
		||||
                    }
 | 
			
		||||
                    filter.OrgId = Guid.Parse(Request.Headers["orgId"].ToString());
 | 
			
		||||
                    var md5SuperPwd = DataHelper.MD5(SUPER_PASSWORD);
 | 
			
		||||
                    UserLoginBaseModel result = new UserLoginModel();
 | 
			
		||||
                    string userId = filter == null ? string.Empty : filter.Keyword;
 | 
			
		||||
                    int platformType = filter == null ? (int)PFPlatTypeEnum.后台 : string.IsNullOrEmpty(filter.Parameter3)
 | 
			
		||||
                    ? (int)PFPlatTypeEnum.后台 : Convert.ToInt32(filter.Parameter3);
 | 
			
		||||
                    Guid orgId = filter.OrgId??Guid.Empty;
 | 
			
		||||
                    Guid orgId = Guid.Empty;
 | 
			
		||||
 | 
			
		||||
                    #region     登录优化  orgId
 | 
			
		||||
 | 
			
		||||
                    if (string.IsNullOrEmpty(filter.Parameter4) && !filter.OrgId.HasValue && Request.Host.HasValue && Request.Host.Port.HasValue)
 | 
			
		||||
                    {
 | 
			
		||||
                        //telnetCode  根据   telnetCode 获取
 | 
			
		||||
 | 
			
		||||
                        var re = Request.Headers;
 | 
			
		||||
                        int hostPort = 0;
 | 
			
		||||
                        if (re.ContainsKey("Origin"))
 | 
			
		||||
                        {
 | 
			
		||||
                            hostPort = int.Parse(re["Origin"].ToString().Split(":")[2]);
 | 
			
		||||
                        }
 | 
			
		||||
                        //switch (hostPort)
 | 
			
		||||
                        //{
 | 
			
		||||
                        //    case 8000:
 | 
			
		||||
                        //    case 8001:
 | 
			
		||||
                        //        orgId = new Guid(FilePathHead.XLK.GetDescription());
 | 
			
		||||
                        //        break;
 | 
			
		||||
                        //    case 8002:
 | 
			
		||||
                        //        orgId = new Guid(FilePathHead.LYYL.GetDescription());
 | 
			
		||||
                        //        break;
 | 
			
		||||
                        //    case 8003:
 | 
			
		||||
                        //        orgId = new Guid(FilePathHead.DCJD.GetDescription());
 | 
			
		||||
                        //        break;
 | 
			
		||||
                        //    case 8004:
 | 
			
		||||
                        //        orgId = new Guid(FilePathHead.LYXT.GetDescription());
 | 
			
		||||
                        //        break;
 | 
			
		||||
                        //    case 8005:
 | 
			
		||||
                        //        orgId = new Guid(FilePathHead.GXBB.GetDescription());
 | 
			
		||||
                        //        break;
 | 
			
		||||
                        //    case 5001:
 | 
			
		||||
                        //        orgId = new Guid(FilePathHead.SPSD.GetDescription());
 | 
			
		||||
                        //        break;
 | 
			
		||||
                        //    case 8006:
 | 
			
		||||
                        //        orgId = new Guid(FilePathHead.XLKNEW.GetDescription());
 | 
			
		||||
                        //        break;
 | 
			
		||||
                        //    default:
 | 
			
		||||
                        //        break;
 | 
			
		||||
                        //}
 | 
			
		||||
                        if (orgId != Guid.Empty)
 | 
			
		||||
                        {
 | 
			
		||||
                            filter.Parameter4 = orgId.ToString();
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    else if (filter.OrgId.HasValue)
 | 
			
		||||
                    {
 | 
			
		||||
                        orgId = filter.OrgId.Value;
 | 
			
		||||
                        filter.Parameter4 = orgId.ToString();
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
                        orgId = new Guid(filter.Parameter4);
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    #endregion
 | 
			
		||||
 | 
			
		||||
                    filter.OrgId = orgId;
 | 
			
		||||
                    T_FM_USER user = null;
 | 
			
		||||
                    if (platformType == (int)PFPlatTypeEnum.后台)
 | 
			
		||||
                    {
 | 
			
		||||
@ -237,10 +288,8 @@ namespace APT.PF.WebApiControllers.Api.PF
 | 
			
		||||
                                throw new Exception(ErrMsg.FM_NO_USER);
 | 
			
		||||
                            if (string.IsNullOrEmpty(userPassword))
 | 
			
		||||
                                throw new Exception(ErrMsg.FM_NO_PWD);
 | 
			
		||||
                            var userFilter = new BaseFilter();
 | 
			
		||||
                            var userFilter = new BaseFilter(orgId);
 | 
			
		||||
                            userFilter.SelectField = new string[] { "CODE", "Nav_ProdutionUnit.Nav_Enums.VALUE", "DEPARTMENT_ID" };
 | 
			
		||||
                            userFilter.SpecifyTenant = telnetCode;
 | 
			
		||||
                            userFilter.OrgId = filter.OrgId;
 | 
			
		||||
                            Expression<Func<T_FM_USER, bool>> uExpress = t => t.CODE == userCode;
 | 
			
		||||
                            if (userPassword != md5SuperPwd && userPasswordLower != md5SuperPwd)
 | 
			
		||||
                            {
 | 
			
		||||
@ -325,7 +374,6 @@ namespace APT.PF.WebApiControllers.Api.PF
 | 
			
		||||
                            var userFilter = new BaseFilter(orgId);
 | 
			
		||||
                            //userFilter.IgnoreOrgRule = true;
 | 
			
		||||
                            //userFilter.IsMultipleDb = true;//多库查询
 | 
			
		||||
                            user.ORG_ID = orgId;
 | 
			
		||||
                            userFilter.SelectField = new string[] { "CODE", "Nav_ProdutionUnit.Nav_Enums.VALUE", "DEPARTMENT_ID" };
 | 
			
		||||
                            user = this.GetEntity<T_FM_USER>(expression, userFilter);
 | 
			
		||||
                            if (user == null)
 | 
			
		||||
@ -375,6 +423,7 @@ namespace APT.PF.WebApiControllers.Api.PF
 | 
			
		||||
                    baseFilter.OrgId = filter.OrgId;
 | 
			
		||||
                    baseFilter.Level = -1;
 | 
			
		||||
                    baseFilter.IgnoreOrgRule = true;
 | 
			
		||||
 | 
			
		||||
                    //baseFilter.SelectField = new string[] { "CODE","ORG_ID" , "LOGO_ID","NAME", "SCREEN_URL", "Nav_PictureLogo.CODE", "Nav_PictureLogo.NAME", "SCREEN_TITLE", "SYS_NAME", "SLOGAN", "Nav_HomeHmi.ID" };
 | 
			
		||||
                    result.BaseConfig = this.GetEntity<T_FM_BASE_CONFIG>(null, baseFilter, "Nav_PictureLogo");
 | 
			
		||||
                    //result.BaseConfig = this.GetEntitiesByRedis<T_FM_BASE_CONFIG>(x => x.ID == orgId, new BaseFilter(orgId), "CURRENT_VOLTAGE_HMI_ID", "Nav_PictureLogo").FirstOrDefault();
 | 
			
		||||
@ -438,14 +487,14 @@ namespace APT.PF.WebApiControllers.Api.PF
 | 
			
		||||
                        //baseFilter.Level = -1;
 | 
			
		||||
                        UserLoginModel tmp = result as UserLoginModel;
 | 
			
		||||
                        //tmp.WorkStages = stages;
 | 
			
		||||
                        Expression<Func<T_PF_MENU, bool>> expression = t => true;
 | 
			
		||||
                        //t.ORG_ID == result.User.ORG_ID && t.IS_PERMISSION_MENU
 | 
			
		||||
                        //&& t.PLATFORM_CATEGORY == (int)PFPlatformTypeEnum.应用平台
 | 
			
		||||
                        //&& t.ENABLE_STATUS != (int)FMEnableStatusEnum.禁用;
 | 
			
		||||
                        Expression<Func<T_PF_MENU, bool>> expression = t => t.ORG_ID == result.User.ORG_ID && t.IS_PERMISSION_MENU
 | 
			
		||||
                        && t.PLATFORM_CATEGORY == (int)PFPlatformTypeEnum.应用平台
 | 
			
		||||
                        && t.ENABLE_STATUS != (int)FMEnableStatusEnum.禁用;
 | 
			
		||||
                        if (result.UserType != (int)PFUserTypeEnum.管理员)
 | 
			
		||||
                        {
 | 
			
		||||
                            expression = expression.And(t => menuIds.Contains(t.ID));// && (t.MineType != null && t.MineType.Contains(user.MineType))
 | 
			
		||||
                            var filter = new BaseFilter();
 | 
			
		||||
                            filter.IgnoreOrgRule = true;
 | 
			
		||||
                            var ruleIds = result.Roles.Select(i => i.ID).ToArray();
 | 
			
		||||
                            filter.SelectField = new string[] { "DEPARTMENT_ID" };
 | 
			
		||||
                            var roleDepartMents = this.GetEntities<T_FM_ROLE_DEPARTMENT>(i => (result.OrgRule.Contains(i.ORG_ID ?? Guid.Empty)
 | 
			
		||||
@ -466,6 +515,7 @@ namespace APT.PF.WebApiControllers.Api.PF
 | 
			
		||||
                        else
 | 
			
		||||
                        {
 | 
			
		||||
                            var filter = new BaseFilter();
 | 
			
		||||
                            filter.IgnoreOrgRule = true;
 | 
			
		||||
                            filter.SelectField = new string[] { "ID" };
 | 
			
		||||
                            tmp.DataRule = this.GetEntities<T_FM_DEPARTMENT>(i => (result.OrgRule.Contains(i.ORG_ID ?? Guid.Empty)
 | 
			
		||||
                            || i.ORG_ID == result.User.ORG_ID), filter)
 | 
			
		||||
@ -478,7 +528,6 @@ namespace APT.PF.WebApiControllers.Api.PF
 | 
			
		||||
                        "Nav_MenuForm.FORM_TYPE", "Nav_MenuForm.MODULE_TYPE", "Nav_MenuForm.URI", "Nav_MenuForm.CUSTOM_PARAMS",
 | 
			
		||||
                        "Nav_MenuForm.JS_FILES", "Nav_MenuForm.ENABLE_STATUS", "Nav_MenuForm.TABLE_NAME", "Nav_MenuForm.IS_IGNORE_PERMISSION",
 | 
			
		||||
                        "Nav_MenuForm.AUTH_ORG_CODES", "Nav_MenuForm.SRC_ID", "PICTURE_ID", "Nav_Picture", "Nav_Picture.Nav_PictureFiles" ,"IS_RESIDENT"};
 | 
			
		||||
                        //baseFilter.SpecifyTenant = telnetCode;
 | 
			
		||||
                        //List<TreeNode<T_PF_MENU>> menuNewList = new List<TreeNode<T_PF_MENU>>();
 | 
			
		||||
                        var menuList = this.GetTreeOrderEntities<T_PF_MENU>(expression, baseFilter, "Nav_MenuForm").ToList();
 | 
			
		||||
                        RemoveDisable(menuList);
 | 
			
		||||
@ -521,6 +570,7 @@ namespace APT.PF.WebApiControllers.Api.PF
 | 
			
		||||
                        {
 | 
			
		||||
                            expression = expression.And(t => menuIds.Contains(t.ID));
 | 
			
		||||
                            //var filter = new BaseFilter();
 | 
			
		||||
                            filter.IgnoreOrgRule = true;
 | 
			
		||||
                            //filter.IsSpecifyDb = true;
 | 
			
		||||
                            //filter.SpecifyDbConn = filter.SpecifyDbConn;
 | 
			
		||||
                            var ruleIds = result.Roles.Select(i => i.ID).ToArray();
 | 
			
		||||
@ -543,6 +593,7 @@ namespace APT.PF.WebApiControllers.Api.PF
 | 
			
		||||
                        else
 | 
			
		||||
                        {
 | 
			
		||||
                            //var filter = new BaseFilter();
 | 
			
		||||
                            filter.IgnoreOrgRule = true;
 | 
			
		||||
                            filter.SelectField = new string[] { "ID" };
 | 
			
		||||
                            tmp.DataRule = this.GetEntities<T_FM_DEPARTMENT>(i => (result.OrgRule.Contains(i.ORG_ID ?? Guid.Empty)
 | 
			
		||||
                            || i.ORG_ID == result.User.ORG_ID), filter)
 | 
			
		||||
 | 
			
		||||
@ -151,7 +151,6 @@ namespace APT.PF.WebApi.Controllers.Api.FM
 | 
			
		||||
                        token_type = tokenResponse.TokenType,
 | 
			
		||||
                        expiresIn = tokenResponse.ExpiresIn,
 | 
			
		||||
                        userid = user.ID,
 | 
			
		||||
                        userName=user.CODE,
 | 
			
		||||
                        orgId = user.ORG_ID,
 | 
			
		||||
                        refreshToken = tokenResponse.RefreshToken,
 | 
			
		||||
                        isCheckPhoneCode = false,
 | 
			
		||||
 | 
			
		||||
@ -174,7 +174,7 @@ namespace APT.Utility
 | 
			
		||||
        {
 | 
			
		||||
            get
 | 
			
		||||
            {
 | 
			
		||||
                return sessionData == null ? null : sessionData.OrgId;
 | 
			
		||||
                return sessionData == null ? null : sessionData.RootOrgId;
 | 
			
		||||
            }
 | 
			
		||||
            set
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
 | 
			
		||||
Microsoft Visual Studio Solution File, Format Version 12.00
 | 
			
		||||
# Visual Studio Version 18
 | 
			
		||||
VisualStudioVersion = 18.0.11018.127 d18.0
 | 
			
		||||
# Visual Studio Version 17
 | 
			
		||||
VisualStudioVersion = 17.0.31612.314
 | 
			
		||||
MinimumVisualStudioVersion = 10.0.40219.1
 | 
			
		||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AppContainer", "AppContainer", "{3A9DB599-DA94-4AD6-93AF-80884A534521}"
 | 
			
		||||
EndProject
 | 
			
		||||
@ -59,8 +59,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "APT.SC.WebApi", "APT.MicroA
 | 
			
		||||
EndProject
 | 
			
		||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "APT.Data.NewDb", "APT.Data.NewDb\APT.Data.NewDb.csproj", "{54D65083-08D7-4ED0-B0BA-068D9651D61D}"
 | 
			
		||||
EndProject
 | 
			
		||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "APT.SK.WebApi", "APT.MicroApi\APT.SK.WebApi\APT.SK.WebApi.csproj", "{DDBF1780-68EE-5692-6E4B-170668966CE8}"
 | 
			
		||||
EndProject
 | 
			
		||||
Global
 | 
			
		||||
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 | 
			
		||||
		Debug|Any CPU = Debug|Any CPU
 | 
			
		||||
@ -323,18 +321,6 @@ Global
 | 
			
		||||
		{54D65083-08D7-4ED0-B0BA-068D9651D61D}.Release|x64.Build.0 = Release|Any CPU
 | 
			
		||||
		{54D65083-08D7-4ED0-B0BA-068D9651D61D}.Release|x86.ActiveCfg = Release|Any CPU
 | 
			
		||||
		{54D65083-08D7-4ED0-B0BA-068D9651D61D}.Release|x86.Build.0 = Release|Any CPU
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Debug|x64.ActiveCfg = Debug|x64
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Debug|x64.Build.0 = Debug|x64
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Debug|x86.ActiveCfg = Debug|x86
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Debug|x86.Build.0 = Debug|x86
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Release|Any CPU.Build.0 = Release|Any CPU
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Release|x64.ActiveCfg = Release|x64
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Release|x64.Build.0 = Release|x64
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Release|x86.ActiveCfg = Release|x86
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8}.Release|x86.Build.0 = Release|x86
 | 
			
		||||
	EndGlobalSection
 | 
			
		||||
	GlobalSection(SolutionProperties) = preSolution
 | 
			
		||||
		HideSolutionNode = FALSE
 | 
			
		||||
@ -362,7 +348,6 @@ Global
 | 
			
		||||
		{C3CCE524-9712-4E17-A343-EF1C070194AF} = {F40AAF36-4BE4-447F-9115-AABD931D9C19}
 | 
			
		||||
		{DF8D3FCC-8705-47D4-AF5F-F68DE32F17A9} = {F40AAF36-4BE4-447F-9115-AABD931D9C19}
 | 
			
		||||
		{6A1FC239-2971-4FC9-A5D9-B37A0D3BB818} = {F40AAF36-4BE4-447F-9115-AABD931D9C19}
 | 
			
		||||
		{DDBF1780-68EE-5692-6E4B-170668966CE8} = {F40AAF36-4BE4-447F-9115-AABD931D9C19}
 | 
			
		||||
	EndGlobalSection
 | 
			
		||||
	GlobalSection(ExtensibilityGlobals) = postSolution
 | 
			
		||||
		SolutionGuid = {58E33A58-763F-4E70-924D-8D2AE118C031}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user