/// <summary> /// OnActionExecuting /// </summary> protected override void OnActionExecuting(ActionExecutingContext filterContext) { base.OnActionExecuting(filterContext); //操作类型 ViewBag.CurrentHandleType = this.CurrentHandleType; ViewBag.UserID = this.UserID; ViewBag.ResourceVersion = this.CurrentApplicationMerchantApp.ResourceVersion; ViewBag.CurrentApplicationMerchantApp = this.CurrentApplicationMerchantApp; ViewBag.CurrentApplicationMerchant = this.CurrentApplicationMerchant; if (null != this.CurrentUserModel) { ViewBag.CurrentUserMerchantApp = this.CurrentUserMerchantApp; ViewBag.CurrentUserMerchant = this.CurrentUserMerchant; ViewBag.UserToken = this.UserToken; } //公共信息 XCLCMS.Lib.Model.CommonModel commonModel = new XCLCMS.Lib.Model.CommonModel(); commonModel.CurrentUserModel = this.CurrentUserModel; ViewBag.CommonModel = commonModel; //分页信息 this.PageParamsInfo = new XCLNetTools.Entity.PagerInfo(XCLNetTools.StringHander.FormHelper.GetInt("page", 1), XCLNetTools.StringHander.FormHelper.GetInt("pageSize", 10), 0); //页面全局配置信息 var pageConfig = new XCLCMS.Lib.Model.PageGlobalConfig(); pageConfig.AppID = XCLCMS.Lib.Common.Comm.AppID; if (null != commonModel) { pageConfig.IsLogOn = commonModel.IsLogOn; if (null != commonModel.CurrentUserModel) { pageConfig.UserID = commonModel.CurrentUserModel.UserInfoID; pageConfig.UserName = commonModel.CurrentUserModel.UserName; } } pageConfig.RootURL = XCLNetTools.StringHander.Common.RootUri; pageConfig.UserToken = this.UserToken; pageConfig.FileManagerFileListURL = XCLCMS.Lib.Common.Setting.SettingModel.FileManager_FileListURL; pageConfig.FileManagerLogicFileListURL = XCLCMS.Lib.Common.Setting.SettingModel.FileManager_LogicFileListURL; pageConfig.WebAPIServiceURL = XCLCMS.Lib.Common.Comm.WebAPIServiceURL; pageConfig.EnumConfig = string.Empty; ViewBag.PageGlobalConfigJSON = string.Format("var XCLCMSPageGlobalConfig={0};XCLCMSPageGlobalConfig.EnumConfig={1};", Newtonsoft.Json.JsonConvert.SerializeObject(pageConfig), XCLCMS.Data.CommonHelper.EnumHelper.GetAllEnumJson); }
/// <summary> /// OnActionExecuting /// </summary> protected override void OnActionExecuting(ActionExecutingContext filterContext) { base.OnActionExecuting(filterContext); //操作类型 ViewBag.CurrentHandleType = this.CurrentHandleType; ViewBag.UserID = this.UserID; ViewBag.ResourceVersion = this.CurrentApplicationMerchantApp.ResourceVersion; ViewBag.CurrentApplicationMerchantApp = this.CurrentApplicationMerchantApp; ViewBag.CurrentApplicationMerchant = this.CurrentApplicationMerchant; if (null != this.CurrentUserModel) { ViewBag.CurrentUserMerchantApp = this.CurrentUserMerchantApp; ViewBag.CurrentUserMerchant = this.CurrentUserMerchant; ViewBag.UserToken = this.UserToken; ViewBag.IsMainUserForMerchant = this.CurrentUserModel.UserType == XCLCMS.Data.CommonHelper.EnumType.UserTypeEnum.MAI.ToString(); } //公共信息 XCLCMS.Lib.Model.CommonModel commonModel = new XCLCMS.Lib.Model.CommonModel(); commonModel.CurrentUserModel = this.CurrentUserModel; ViewBag.CommonModel = commonModel; //分页信息 this.PageParamsInfo = new XCLNetTools.Entity.PagerInfo(XCLNetTools.StringHander.FormHelper.GetInt("page", 1), XCLNetTools.StringHander.FormHelper.GetInt("pageSize", 10), 0); //页面全局配置信息 var pageConfig = new XCLCMS.Lib.Model.PageGlobalConfig(); pageConfig.IsLogOn = commonModel.IsLogOn; if (null != commonModel.CurrentUserModel) { pageConfig.UserID = commonModel.CurrentUserModel.UserInfoID; pageConfig.UserName = commonModel.CurrentUserModel.UserName; } pageConfig.RootURL = XCLNetTools.StringHander.Common.RootUri; pageConfig.FileManagerFileListURL = XCLCMS.Lib.Common.Setting.SettingModel.FileManager_FileListURL; pageConfig.FileManagerLogicFileListURL = XCLCMS.Lib.Common.Setting.SettingModel.FileManager_LogicFileListURL; pageConfig.WebAPIServiceURL = XCLCMS.Lib.Common.Comm.WebAPIServiceURL; pageConfig.ClientIP = XCLNetTools.Common.IPHelper.GetClientIP(); pageConfig.Url = Request.Url?.AbsoluteUri; pageConfig.Reffer = Request.UrlReferrer?.AbsoluteUri; pageConfig.EnumConfig = string.Empty; ViewBag.PageGlobalConfigJSON = string.Format("var XCLCMSPageGlobalConfig={0};XCLCMSPageGlobalConfig.EnumConfig={1};", Newtonsoft.Json.JsonConvert.SerializeObject(pageConfig), XCLCMS.Lib.Common.Comm.GetAllEnumJson); #region meta信息设置 //设置title if (string.IsNullOrWhiteSpace(ViewBag.Title)) { ViewBag.Title = this.CurrentApplicationMerchantApp.MetaTitle; } else { ViewBag.Title = string.Format("{0}—{1}", ViewBag.Title, this.CurrentApplicationMerchantApp.MetaTitle); } //设置keywords if (string.IsNullOrWhiteSpace(ViewBag.KeyWords)) { ViewBag.KeyWords = this.CurrentApplicationMerchantApp.MetaKeyWords; } else { ViewBag.KeyWords = string.Format("{0}—{1}", ViewBag.KeyWords, this.CurrentApplicationMerchantApp.MetaKeyWords); } //设置description if (string.IsNullOrWhiteSpace(ViewBag.Description)) { ViewBag.Description = this.CurrentApplicationMerchantApp.MetaDescription; } else { ViewBag.Description = string.Format("{0}—{1}", ViewBag.Description, this.CurrentApplicationMerchantApp.MetaDescription); } #endregion meta信息设置 }