using Furion; using Microsoft.Extensions.Configuration; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RoadFlow.Utility { /// /// 系统配置类 /// public class Config { /// /// 当前系统版本 /// public static string SystemVersion { get; set; } /// /// 数据库类型 /// public static string DatabaseType { get; set; } /// /// SqlServer连接字符串 /// public static string ConnectionString_SqlServer { get; set; } /// /// MySql连接字符串 /// public static string ConnectionString_MySql { get; set; } /// /// Oracle连接字符串 /// public static string ConnectionString_Oracle { get; set; } /// /// PostgreSql连接字符串 /// public static string ConnectionString_PostgreSql { get; set; } /// /// 当前系统使用的连接字符串 /// public static string ConnectionString { get { switch (DatabaseType) { case "sqlserver": return ConnectionString_SqlServer; case "mysql": return ConnectionString_MySql; case "oracle": return ConnectionString_Oracle; case "postgresql": return ConnectionString_PostgreSql; } return string.Empty; } } /// /// cookie名称 /// public static string CookieName { get; set; } = "RoadFlowCore.Session"; /// /// cookie路径 /// public static string CookiePath { get; set; } = "/"; /// /// 用户ID的Session Key /// public static string UserIdSessionKey { get; set; } = "RoadFlowUserId"; /// /// session过期时间 /// public static int SessionTimeout { get; set; } = 20; /// /// 系统登录地址 /// public static string LoginUrl { get; set; } /// /// 根路径 /// public static string RootUrl { get; set; } /// /// 人员初始密码 /// public static string InitUserPassword { get; set; } = "111"; /// /// 每页显示条数 /// public static int PageSize { get; set; } = 15; /// /// 是否调试模式(开发模式) /// public static bool IsDebug { get; set; } = false; /// /// 是否开启单点登录(只能在一个地方登录) /// public static bool SingleLogin { get; set; } = true; /// /// 是否将错误信息显示到客户端(0不显示 1显示) /// public static int ShowError { get; set; } = 0; /// /// 调试模式时的用户ID /// public static string DebugUserId { get; set; } /// /// 附件保存路径 /// public static string FilePath { get; set; } /// /// 允许上传的文件类型 /// public static string UploadFileExtNames { get; set; } /// /// 是否启用动态步骤功能 /// public static bool EnableDynamicStep { get; set; } = false; /// /// 是否IFRAME的方式集成(其它系统以IFRAME方式直接加载本系统页面,本系统独立部署) /// public static bool IsIntegrateIframe { get; set; } = false; /// /// IFRAME的方式集成的地址 /// public static string IntegrateIframeUrl { get; set; } = ""; /// /// 前端地址 /// public static string UiAddress { get; set; } /// /// 是否是VUE前后端分离模式 /// public static bool IsVue { get { return App.GetConfig("UtilityConfig.IsVue"); } } /// /// 站点绝对路径 /// public static string ContentRootPath { get; set; } = string.Empty; /// /// LibreOffice program\soffice.exe所在路径 /// public static string LibreOfficePath { get; set; } = string.Empty; /// /// 公共语言包 /// public static IConfigurationRoot LangConf { get; set; } #region 企业微信相关配置 /// /// 企业ID /// public static string Enterprise_WeiXin_AppId { get; set; } /// /// 外网地址 /// public static string Enterprise_WeiXin_WebUrl { get; set; } /// /// 是否使用企业微信 /// public static bool Enterprise_WeiXin_IsUse { get; set; } = false; /// /// 是否要同步组织架构 /// public static bool Enterprise_WeiXin_IsSyncOrg { get; set; } = false; #endregion #region 微信公众号相关配置 /// /// 是否启用公众号 /// public static bool WeiXin_IsUse { get; set; } = false; /// /// 公众号APPID /// public static string WeiXin_AppId { get; set; } /// /// 公众号AppSecret /// public static string WeiXin_AppSecret { get; set; } /// /// 外网地址 /// public static string WeiXin_WebUrl { get; set; } #endregion #region 引擎中心相关 /// /// 是否启用引擎中心 /// public static bool EngineCenter_IsUse { get; set; } = false; #endregion #region 多语言配置 /// /// 默认语言 /// public static string Language_Default { get; set; } /// /// 语言列表 /// public static List Language_CultureInfos { get { return new List{ new CultureInfo("zh-CN"), new CultureInfo("zh"), new CultureInfo("en-US") }; } } /// /// 语言列表 /// public static Dictionary Language_Dictionary { get { return new Dictionary { { "zh-CN", "简体中文"}, { "zh", "繁體中文"}, { "en-US", "English"} }; } } /// /// 语言cookie名称 /// public static string Language_CookieName { get; set; } = ".AspNetCore.Culture"; #endregion #region VUE版企业微信配置 /// /// VUE版是否使用企业微信 /// public static bool EnterpriseWeChatIsUse { get; set; } = false; /// /// VUE版企业微信ID /// public static string EnterpriseWeChatAppId { get; set; } = string.Empty; /// /// VUE版企业微信外网地址 /// public static string EnterpriseWeChatWebUrl { get; set; } = string.Empty; /// /// VUE版是否企业微信是否同步组织架构 /// public static bool EnterpriseWeChatIsSyncOrganize { get; set; } = false; /// /// VUE版企业微信后台第一个应用的AgentId /// public static string EnterpriseWeChatAgentId { get; set; } = string.Empty; /// /// VUE版企业微信后台第一个应用的Secret /// public static string EnterpriseWeChatSecret { get; set; } = string.Empty; /// /// VUE版企业微信通讯录同步Secret /// public static string EnterpriseWeChatOrganizeSecret { get; set; } = string.Empty; /// /// VUE版企业微信接收消息应用AgentId /// public static string EnterpriseWeChatMessageAgentId { get; set; } = string.Empty; /// /// VUE版企业微信接收消息应用Secret /// public static string EnterpriseWeChatMessageSecret { get; set; } = string.Empty; #endregion # region 邮件配置 /// /// 邮件服务器 /// public static string MailServer { get; set; } /// /// 邮件服务器端口 /// public static int MailPort { get; set; } = 587; /// /// 邮件服务器是否使用sll /// public static bool MailEnableSsl { get; set; } = false; /// /// 邮件帐号 /// public static string MailAccount { get; set; } /// /// 邮件密码 /// public static string MailPassword { get; set; } /// /// 邮件默认发件人 /// public static string MailSenderName { get; set; } /// /// 邮件默认发件箱 /// public static string MailSenderMail { get; set; } /// /// 邮件待办处理连接有效天数 /// public static int MailTokenExpireDays { get; set; } = 3; #endregion } }