insertAuthRole(Long userId, Long[] roleIds) {
+ userService.insertUserAuth(userId, roleIds);
+ return success();
+ }
+}
diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml
new file mode 100644
index 00000000..9bc5a770
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/application-dev.yml
@@ -0,0 +1,158 @@
+--- # 监控配置
+spring:
+ boot:
+ admin:
+ # Spring Boot Admin Client 客户端的相关配置
+ client:
+ # 增加客户端开关
+ enabled: true
+ # 设置 Spring Boot Admin Server 地址
+ url: http://localhost:9090/admin
+ instance:
+ prefer-ip: true # 注册实例时,优先使用 IP
+ username: ruoyi
+ password: 123456
+
+--- # xxl-job 配置
+xxl:
+ job:
+ # 执行器开关
+ enabled: true
+ # 调度中心地址:如调度中心集群部署存在多个地址则用逗号分隔。
+ admin-addresses: http://localhost:9100/xxl-job-admin
+ # 执行器通讯TOKEN:非空时启用
+ access-token: xxl-job
+ # 执行器配置
+ executor:
+ # 执行器AppName:执行器心跳注册分组依据;为空则关闭自动注册
+ appname: xxl-job-executor
+ # 执行器端口号 执行器从9101开始往后写
+ port: 9101
+ # 执行器注册:默认IP:PORT
+ address:
+ # 执行器IP:默认自动获取IP
+ ip:
+ # 执行器运行日志文件存储磁盘路径
+ logpath: ./logs/xxl-job
+ # 执行器日志文件保存天数:大于3生效
+ logretentiondays: 30
+
+--- # 数据源配置
+spring:
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
+ dynamic:
+ # 性能分析插件(有性能损耗 不建议生产环境使用)
+ p6spy: true
+ # 设置默认的数据源或者数据源组,默认值即为 master
+ primary: master
+ datasource:
+ # 主库数据源
+ master:
+ driverClassName: com.mysql.cj.jdbc.Driver
+ url: jdbc:mysql://localhost:3306/ry-flowable-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+ username: root
+ password: 123456
+ # 从库数据源
+ slave:
+ lazy: true
+ driverClassName: com.mysql.cj.jdbc.Driver
+ url:
+ username:
+ password:
+ druid:
+ # 初始连接数
+ initialSize: 5
+ # 最小连接池数量
+ minIdle: 10
+ # 最大连接池数量
+ maxActive: 20
+ # 配置获取连接等待超时的时间
+ maxWait: 60000
+ # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+ timeBetweenEvictionRunsMillis: 60000
+ # 配置一个连接在池中最小生存的时间,单位是毫秒
+ minEvictableIdleTimeMillis: 300000
+ # 配置一个连接在池中最大生存的时间,单位是毫秒
+ maxEvictableIdleTimeMillis: 900000
+ # 配置检测连接是否有效
+ validationQuery: SELECT 1 FROM DUAL
+ testWhileIdle: true
+ testOnBorrow: false
+ testOnReturn: false
+ # 注意这个值和druid原生不一致,默认启动了stat
+ filters: stat
+
+--- # druid 配置
+spring:
+ datasource:
+ druid:
+ webStatFilter:
+ enabled: true
+ statViewServlet:
+ enabled: true
+ # 设置白名单,不填则允许所有访问
+ allow:
+ url-pattern: /druid/*
+ # 控制台管理用户名和密码
+ login-username: ruoyi
+ login-password: 123456
+ filter:
+ stat:
+ enabled: true
+ # 慢SQL记录
+ log-slow-sql: true
+ slow-sql-millis: 1000
+ merge-sql: true
+ wall:
+ config:
+ multi-statement-allow: true
+
+--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
+spring:
+ redis:
+ # 地址
+ host: localhost
+ # 端口,默认为6379
+ port: 6379
+ # 数据库索引
+ database: 0
+ # 密码
+ password:
+ # 连接超时时间
+ timeout: 10s
+ # 是否开启ssl
+ ssl: false
+
+redisson:
+ # 线程池数量
+ threads: 16
+ # Netty线程池数量
+ nettyThreads: 32
+ # 传输模式
+ transportMode: "NIO"
+ # 单节点配置
+ singleServerConfig:
+ # 客户端名称
+ clientName: ${ruoyi.name}
+ # 最小空闲连接数
+ connectionMinimumIdleSize: 32
+ # 连接池大小
+ connectionPoolSize: 64
+ # 连接空闲超时,单位:毫秒
+ idleConnectionTimeout: 10000
+ # 命令等待超时,单位:毫秒
+ timeout: 3000
+ # 如果尝试在此限制之内发送成功,则开始启用 timeout 计时。
+ retryAttempts: 3
+ # 命令重试发送时间间隔,单位:毫秒
+ retryInterval: 1500
+ # 发布和订阅连接的最小空闲连接数
+ subscriptionConnectionMinimumIdleSize: 1
+ # 发布和订阅连接池大小
+ subscriptionConnectionPoolSize: 50
+ # 单个连接最大订阅数量
+ subscriptionsPerConnection: 5
+ # DNS监测时间间隔,单位:毫秒
+ dnsMonitoringInterval: 5000
diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml
new file mode 100644
index 00000000..1d680d7d
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/application-prod.yml
@@ -0,0 +1,165 @@
+--- # 配置临时路径存储
+spring:
+ servlet:
+ multipart:
+ # 临时文件存储位置 避免临时文件被系统清理报错
+ location: /ruoyi/server/temp
+
+--- # 监控配置
+spring:
+ boot:
+ admin:
+ # Spring Boot Admin Client 客户端的相关配置
+ client:
+ # 增加客户端开关
+ enabled: true
+ # 设置 Spring Boot Admin Server 地址
+ url: http://172.30.0.90:9090/admin
+ instance:
+ prefer-ip: true # 注册实例时,优先使用 IP
+ username: ruoyi
+ password: 123456
+
+--- # xxl-job 配置
+xxl:
+ job:
+ # 执行器开关
+ enabled: true
+ # 调度中心地址:如调度中心集群部署存在多个地址则用逗号分隔。
+ admin-addresses: http://172.30.0.92:9100/xxl-job-admin
+ # 执行器通讯TOKEN:非空时启用
+ access-token: xxl-job
+ # 执行器配置
+ executor:
+ # 执行器AppName:执行器心跳注册分组依据;为空则关闭自动注册
+ appname: xxl-job-executor
+ # 执行器端口号 执行器从9101开始往后写
+ port: 9101
+ # 执行器注册:默认IP:PORT
+ address:
+ # 执行器IP:默认自动获取IP
+ ip:
+ # 执行器运行日志文件存储磁盘路径
+ logpath: ./logs/xxl-job
+ # 执行器日志文件保存天数:大于3生效
+ logretentiondays: 30
+
+--- # 数据源配置
+spring:
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
+ dynamic:
+ # 性能分析插件(有性能损耗 不建议生产环境使用)
+ p6spy: false
+ # 设置默认的数据源或者数据源组,默认值即为 master
+ primary: master
+ datasource:
+ # 主库数据源
+ master:
+ driverClassName: com.mysql.cj.jdbc.Driver
+ url: jdbc:mysql://172.30.0.36:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+ username: root
+ password: root
+ # 从库数据源
+ slave:
+ lazy: true
+ driverClassName: com.mysql.cj.jdbc.Driver
+ url:
+ username:
+ password:
+ druid:
+ # 初始连接数
+ initialSize: 5
+ # 最小连接池数量
+ minIdle: 10
+ # 最大连接池数量
+ maxActive: 20
+ # 配置获取连接等待超时的时间
+ maxWait: 60000
+ # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+ timeBetweenEvictionRunsMillis: 60000
+ # 配置一个连接在池中最小生存的时间,单位是毫秒
+ minEvictableIdleTimeMillis: 300000
+ # 配置一个连接在池中最大生存的时间,单位是毫秒
+ maxEvictableIdleTimeMillis: 900000
+ # 配置检测连接是否有效
+ validationQuery: SELECT 1 FROM DUAL
+ testWhileIdle: true
+ testOnBorrow: false
+ testOnReturn: false
+ # 注意这个值和druid原生不一致,默认启动了stat
+ filters: stat
+
+--- # druid 配置
+spring:
+ datasource:
+ druid:
+ webStatFilter:
+ enabled: true
+ statViewServlet:
+ enabled: true
+ # 设置白名单,不填则允许所有访问
+ allow:
+ url-pattern: /druid/*
+ # 控制台管理用户名和密码
+ login-username: ruoyi
+ login-password: 123456
+ filter:
+ stat:
+ enabled: true
+ # 慢SQL记录
+ log-slow-sql: true
+ slow-sql-millis: 1000
+ merge-sql: true
+ wall:
+ config:
+ multi-statement-allow: true
+
+--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
+spring:
+ redis:
+ # 地址
+ host: 172.30.0.48
+ # 端口,默认为6379
+ port: 6379
+ # 数据库索引
+ database: 0
+ # 密码
+ password:
+ # 连接超时时间
+ timeout: 10s
+ # 是否开启ssl
+ ssl: false
+
+redisson:
+ # 线程池数量
+ threads: 16
+ # Netty线程池数量
+ nettyThreads: 32
+ # 传输模式
+ transportMode: "NIO"
+ # 单节点配置
+ singleServerConfig:
+ # 客户端名称
+ clientName: ${ruoyi.name}
+ # 最小空闲连接数
+ connectionMinimumIdleSize: 32
+ # 连接池大小
+ connectionPoolSize: 64
+ # 连接空闲超时,单位:毫秒
+ idleConnectionTimeout: 10000
+ # 命令等待超时,单位:毫秒
+ timeout: 3000
+ # 如果尝试在此限制之内发送成功,则开始启用 timeout 计时。
+ retryAttempts: 3
+ # 命令重试发送时间间隔,单位:毫秒
+ retryInterval: 1500
+ # 发布和订阅连接的最小空闲连接数
+ subscriptionConnectionMinimumIdleSize: 1
+ # 发布和订阅连接池大小
+ subscriptionConnectionPoolSize: 50
+ # 单个连接最大订阅数量
+ subscriptionsPerConnection: 5
+ # DNS监测时间间隔,单位:毫秒
+ dnsMonitoringInterval: 5000
diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
new file mode 100644
index 00000000..f7ef6339
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -0,0 +1,297 @@
+# 项目相关配置
+ruoyi:
+ # 名称
+ name: RuoYi-Vue-Plus
+ # 版本
+ version: ${ruoyi-vue-plus.version}
+ # 版权年份
+ copyrightYear: 2021
+ # 实例演示开关
+ demoEnabled: true
+ # 获取ip地址开关
+ addressEnabled: true
+ # 缓存懒加载
+ cacheLazy: true
+
+captcha:
+ # 页面 <参数设置> 可开启关闭 验证码校验
+ # 验证码类型 math 数组计算 char 字符验证
+ type: MATH
+ # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
+ category: CIRCLE
+ # 数字验证码位数
+ numberLength: 1
+ # 字符验证码长度
+ charLength: 4
+
+# 开发环境配置
+server:
+ # 服务器的HTTP端口,默认为8080
+ port: 8080
+ servlet:
+ # 应用的访问路径
+ context-path: /
+ # undertow 配置
+ undertow:
+ # HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
+ max-http-post-size: -1
+ # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
+ # 每块buffer的空间大小,越小的空间被利用越充分
+ buffer-size: 512
+ # 是否分配的直接内存
+ direct-buffers: true
+ threads:
+ # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
+ io: 8
+ # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
+ worker: 256
+
+# 日志配置
+logging:
+ level:
+ com.ruoyi: @logging.level@
+ org.springframework: warn
+ config: classpath:logback.xml
+
+# tlog 全局访问性能拦截
+tlog:
+ enable-invoke-time-print: true
+
+# Spring配置
+spring:
+ application:
+ name: ${ruoyi.name}
+ # 资源信息
+ messages:
+ # 国际化资源文件路径
+ basename: i18n/messages
+ profiles:
+ active: @profiles.active@
+ # 文件上传
+ servlet:
+ multipart:
+ # 单个文件大小
+ max-file-size: 10MB
+ # 设置总上传的文件大小
+ max-request-size: 20MB
+ # 服务模块
+ devtools:
+ restart:
+ # 热部署开关
+ enabled: true
+ # 与vue整合部署使用
+ thymeleaf:
+ # 将系统模板放置到最前面 否则会与 springboot-admin 页面冲突
+ template-resolver-order: 1
+ jackson:
+ # 日期格式化
+ date-format: yyyy-MM-dd HH:mm:ss
+ serialization:
+ # 格式化输出
+ indent_output: false
+ # 忽略无法转换的对象
+ fail_on_empty_beans: false
+ deserialization:
+ # 允许对象忽略json中不存在的属性
+ fail_on_unknown_properties: false
+
+# token配置
+token:
+ # 令牌自定义标识
+ header: Authorization
+ # 令牌密钥
+ secret: abcdefghijklmnopqrstuvwxyz
+ # 令牌有效期(默认30分钟)
+ expireTime: 30
+
+# security配置
+security:
+ # 登出路径
+ logout-url: /logout
+ # 匿名路径
+ anonymous:
+ - /login
+ - /register
+ - /captchaImage
+ # swagger 文档配置
+ - /doc.html
+ - /swagger-resources/**
+ - /webjars/**
+ - /*/api-docs
+ # druid 监控配置
+ - /druid/**
+ # actuator 监控配置
+ - /actuator
+ - /actuator/**
+ # 用户放行
+ permit-all:
+
+# 重复提交
+repeat-submit:
+ # 全局间隔时间(毫秒)
+ interval: 5000
+
+# MyBatisPlus配置
+# https://baomidou.com/config/
+mybatis-plus:
+ # 不支持多包, 如有需要可在注解配置 或 提升扫包等级
+ # 例如 com.**.**.mapper
+ mapperPackage: com.ruoyi.**.mapper
+ # 对应的 XML 文件位置
+ mapperLocations: classpath*:mapper/**/*Mapper.xml
+ # 实体扫描,多个package用逗号或者分号分隔
+ typeAliasesPackage: com.ruoyi.**.domain
+ # 启动时是否检查 MyBatis XML 文件的存在,默认不检查
+ checkConfigLocation: false
+ # 通过该属性可指定 MyBatis 的执行器,MyBatis 的执行器总共有三种:
+ # SIMPLE:每个语句创建新的预处理器 REUSE:会复用预处理器 BATCH:批量执行所有的更新
+ executorType: SIMPLE
+ configuration:
+ # 自动驼峰命名规则(camel case)映射
+ mapUnderscoreToCamelCase: true
+ # 当设置为 true 的时候,懒加载的对象可能被任何懒属性全部加载,否则,每个属性都按需加载。需要和 lazyLoadingEnabled 一起使用。
+ aggressiveLazyLoading: true
+ # MyBatis 自动映射策略
+ # NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射
+ autoMappingBehavior: PARTIAL
+ # MyBatis 自动映射时未知列或未知属性处理策
+ # NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息
+ autoMappingUnknownColumnBehavior: NONE
+ # Mybatis一级缓存,默认为 SESSION
+ # SESSION session级别缓存 STATEMENT 关闭一级缓存
+ localCacheScope: SESSION
+ # 开启Mybatis二级缓存,默认为 true
+ cacheEnabled: false
+ # 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
+ # 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
+ # 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl
+ logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl
+ global-config:
+ # 是否打印 Logo banner
+ banner: true
+ # 是否初始化 SqlRunner
+ enableSqlRunner: false
+ dbConfig:
+ # 主键类型
+ # AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID
+ idType: AUTO
+ # 表名是否使用驼峰转下划线命名,只对表名生效
+ tableUnderline: true
+ # 大写命名,对表名和字段名均生效
+ capitalMode: false
+ # 逻辑已删除值
+ logicDeleteValue: 2
+ # 逻辑未删除值
+ logicNotDeleteValue: 0
+ # 字段验证策略之 insert,在 insert 的时候的字段验证策略
+ # IGNORED 忽略 NOT_NULL 非NULL NOT_EMPTY 非空 DEFAULT 默认 NEVER 不加入 SQL
+ insertStrategy: NOT_NULL
+ # 字段验证策略之 update,在 update 的时候的字段验证策略
+ updateStrategy: NOT_NULL
+ # 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件
+ where-strategy: NOT_NULL
+
+# Swagger配置
+swagger:
+ # 是否开启swagger
+ enabled: true
+ # 请求前缀
+ pathMapping: /dev-api
+ # 标题
+ title: '标题:${ruoyi.name}后台管理系统_接口文档'
+ # 描述
+ description: '描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...'
+ # 版本
+ version: '版本号: ${ruoyi-vue-plus.version}'
+ # 作者信息
+ contact:
+ name: Lion Li
+ email: crazylionli@163.com
+ url: https://gitee.com/JavaLionLi/RuoYi-Vue-Plus
+ groups:
+ - name: 1.演示案例
+ basePackage: com.ruoyi.demo
+ - name: 2.系统模块
+ basePackage: com.ruoyi.web
+ - name: 3.代码生成模块
+ basePackage: com.ruoyi.generator
+
+knife4j:
+ # 是否开启Knife4j增强模式
+ enable: true
+ # 是否开启生产环境保护策略
+ production: @knife4j.production@
+ # 前端Ui的个性化配置属性
+ setting:
+ # 默认语言
+ language: zh-CN
+ # 是否显示Footer
+ enableFooter: false
+ # 是否开启动态参数调试功能
+ enableDynamicParameter: true
+ # 是否在每个Debug调试栏后显示刷新变量按钮
+ enableReloadCacheParameter: true
+
+# 防止XSS攻击
+xss:
+ # 过滤开关
+ enabled: true
+ # 排除链接(多个用逗号分隔)
+ excludes: /system/notice
+ # 匹配链接
+ urlPatterns: /system/*,/monitor/*,/tool/*
+
+# 全局线程池相关配置
+thread-pool:
+ # 是否开启线程池
+ enabled: false
+ # 核心线程池大小
+ corePoolSize: 8
+ # 最大可创建的线程数
+ maxPoolSize: 16
+ # 队列最大长度
+ queueCapacity: 128
+ # 线程池维护线程所允许的空闲时间
+ keepAliveSeconds: 300
+ # 线程池对拒绝任务(无线程可用)的处理策略
+ # CALLER_RUNS_POLICY 调用方执行
+ # DISCARD_OLDEST_POLICY 放弃最旧的
+ # DISCARD_POLICY 丢弃
+ # ABORT_POLICY 中止
+ rejectedExecutionHandler: CALLER_RUNS_POLICY
+
+--- # redisson 缓存配置
+redisson:
+ cacheGroup:
+ # 用例: @Cacheable(cacheNames="groupId", key="#XXX") 方可使用缓存组配置
+ - groupId: redissonCacheMap
+ # 组过期时间(脚本监控)
+ ttl: 60000
+ # 组最大空闲时间(脚本监控)
+ maxIdleTime: 60000
+ # 组最大长度
+ maxSize: 0
+ - groupId: testCache
+ ttl: 1000
+ maxIdleTime: 500
+
+--- # 分布式锁 lock4j 全局配置
+lock4j:
+ # 获取分布式锁超时时间,默认为 3000 毫秒
+ acquire-timeout: 3000
+ # 分布式锁的超时时间,默认为 30 毫秒
+ expire: 30000
+
+--- # Actuator 监控端点的配置项
+management:
+ endpoints:
+ web:
+ # Actuator 提供的 API 接口的根目录。默认为 /actuator
+ base-path: /actuator
+ exposure:
+ # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
+ # 生产环境不建议放开所有 根据项目需求放开即可
+ include: @endpoints.include@
+ endpoint:
+ logfile:
+ external-file: ./logs/sys-console.log
diff --git a/ruoyi-admin/src/main/resources/banner.txt b/ruoyi-admin/src/main/resources/banner.txt
new file mode 100644
index 00000000..f592dbe1
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/banner.txt
@@ -0,0 +1,8 @@
+Application Version: ${ruoyi-vue-plus.version}
+Spring Boot Version: ${spring-boot.version}
+__________ _____.___.__ ____ ____ __________.__
+\______ \__ __ ____\__ | |__| \ \ / /_ __ ____ \______ \ | __ __ ______
+ | _/ | \/ _ \/ | | | ______ \ Y / | \_/ __ \ ______ | ___/ | | | \/ ___/
+ | | \ | ( <_> )____ | | /_____/ \ /| | /\ ___/ /_____/ | | | |_| | /\___ \
+ |____|_ /____/ \____// ______|__| \___/ |____/ \___ > |____| |____/____//____ >
+ \/ \/ \/ \/
diff --git a/ruoyi-admin/src/main/resources/i18n/messages.properties b/ruoyi-admin/src/main/resources/i18n/messages.properties
new file mode 100644
index 00000000..ede2df8c
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/i18n/messages.properties
@@ -0,0 +1,32 @@
+#错误消息
+not.null=* 必须填写
+user.jcaptcha.error=验证码错误
+user.jcaptcha.expire=验证码已失效
+user.not.exists=用户不存在/密码错误
+user.password.not.match=用户不存在/密码错误
+user.password.retry.limit.count=密码输入错误{0}次
+user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟
+user.password.delete=对不起,您的账号已被删除
+user.blocked=用户已封禁,请联系管理员
+role.blocked=角色已封禁,请联系管理员
+user.logout.success=退出成功
+length.not.valid=长度必须在{min}到{max}个字符之间
+user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
+user.password.not.valid=* 5-50个字符
+user.email.not.valid=邮箱格式错误
+user.mobile.phone.number.not.valid=手机号格式错误
+user.login.success=登录成功
+user.register.success=注册成功
+user.notfound=请重新登录
+user.forcelogout=管理员强制退出,请重新登录
+user.unknown.error=未知错误,请重新登录
+##文件上传消息
+upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB!
+upload.filename.exceed.length=上传的文件名最长{0}个字符
+##权限
+no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
+no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
+no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
+no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
+no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
+no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
diff --git a/ruoyi-admin/src/main/resources/i18n/messages_en_US.properties b/ruoyi-admin/src/main/resources/i18n/messages_en_US.properties
new file mode 100644
index 00000000..af57cf4e
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/i18n/messages_en_US.properties
@@ -0,0 +1,32 @@
+#错误消息
+not.null=* Required fill in
+user.jcaptcha.error=Captcha error
+user.jcaptcha.expire=Captcha invalid
+user.not.exists=User does not exist/Password error
+user.password.not.match=User does not exist/Password error
+user.password.retry.limit.count=Password input error {0} times
+user.password.retry.limit.exceed=Password input error {0} times, account locked for 10 minutes
+user.password.delete=Sorry, your account has been deleted
+user.blocked=User disabled,please contact administrators
+role.blocked=Role disabled,please contact administrators
+user.logout.success=Exit successful
+length.not.valid=The length must be between {min} and {max} characters
+user.username.not.valid=* 2 to 20 chinese characters, letters, numbers or underscores, and must start with a non number
+user.password.not.valid=* 5-50 characters
+user.email.not.valid=Mailbox format error
+user.mobile.phone.number.not.valid=Phone number format error
+user.login.success=Login successful
+user.register.success=Register successful
+user.notfound=Please login again
+user.forcelogout=The administrator is forced to exit,please login again
+user.unknown.error=Unknown error, please login again
+##文件上传消息
+upload.exceed.maxSize=The uploaded file size exceeds the limit file size!
the maximum allowed file size is:{0}MB!
+upload.filename.exceed.length=The maximum length of uploaded file name is {0} characters
+##权限
+no.permission=You do not have permission to the data,please contact your administrator to add permissions [{0}]
+no.create.permission=You do not have permission to create data,please contact your administrator to add permissions [{0}]
+no.update.permission=You do not have permission to modify data,please contact your administrator to add permissions [{0}]
+no.delete.permission=You do not have permission to delete data,please contact your administrator to add permissions [{0}]
+no.export.permission=You do not have permission to export data,please contact your administrator to add permissions [{0}]
+no.view.permission=You do not have permission to view data,please contact your administrator to add permissions [{0}]
diff --git a/ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties b/ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties
new file mode 100644
index 00000000..ede2df8c
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties
@@ -0,0 +1,32 @@
+#错误消息
+not.null=* 必须填写
+user.jcaptcha.error=验证码错误
+user.jcaptcha.expire=验证码已失效
+user.not.exists=用户不存在/密码错误
+user.password.not.match=用户不存在/密码错误
+user.password.retry.limit.count=密码输入错误{0}次
+user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟
+user.password.delete=对不起,您的账号已被删除
+user.blocked=用户已封禁,请联系管理员
+role.blocked=角色已封禁,请联系管理员
+user.logout.success=退出成功
+length.not.valid=长度必须在{min}到{max}个字符之间
+user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
+user.password.not.valid=* 5-50个字符
+user.email.not.valid=邮箱格式错误
+user.mobile.phone.number.not.valid=手机号格式错误
+user.login.success=登录成功
+user.register.success=注册成功
+user.notfound=请重新登录
+user.forcelogout=管理员强制退出,请重新登录
+user.unknown.error=未知错误,请重新登录
+##文件上传消息
+upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB!
+upload.filename.exceed.length=上传的文件名最长{0}个字符
+##权限
+no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
+no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
+no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
+no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
+no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
+no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
diff --git a/ruoyi-admin/src/main/resources/logback.xml b/ruoyi-admin/src/main/resources/logback.xml
new file mode 100644
index 00000000..6e3280fb
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/logback.xml
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+ ${console.log.pattern}
+ utf-8
+
+
+
+
+
+ ${log.path}/sys-console.log
+
+
+ ${log.path}/sys-console.%d{yyyy-MM-dd}.log
+
+ 1
+
+
+ ${log.pattern}
+ utf-8
+
+
+
+ INFO
+
+
+
+
+
+ ${log.path}/sys-info.log
+
+
+
+ ${log.path}/sys-info.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+ ${log.pattern}
+
+
+
+ INFO
+
+ ACCEPT
+
+ DENY
+
+
+
+
+ ${log.path}/sys-error.log
+
+
+
+ ${log.path}/sys-error.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+ ${log.pattern}
+
+
+
+ ERROR
+
+ ACCEPT
+
+ DENY
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ruoyi-admin/src/main/resources/spy.properties b/ruoyi-admin/src/main/resources/spy.properties
new file mode 100644
index 00000000..918f1cb5
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/spy.properties
@@ -0,0 +1,24 @@
+# p6spy 性能分析插件配置文件
+modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
+# 自定义日志打印
+logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
+#日志输出到控制台
+appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
+# 使用日志系统记录 sql
+#appender=com.p6spy.engine.spy.appender.Slf4JLogger
+# 设置 p6spy driver 代理
+#deregisterdrivers=true
+# 取消JDBC URL前缀
+useprefix=true
+# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset.
+excludecategories=info,debug,result,commit,resultset
+# 日期格式
+dateformat=yyyy-MM-dd HH:mm:ss
+# 实际驱动可多个
+#driverlist=org.h2.Driver
+# 是否开启慢SQL记录
+outagedetection=true
+# 慢SQL记录标准 2 秒
+outagedetectioninterval=2
+# 是否过滤 Log
+filter=true
diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml
new file mode 100644
index 00000000..4a0e1a86
--- /dev/null
+++ b/ruoyi-common/pom.xml
@@ -0,0 +1,156 @@
+
+
+
+ ruoyi-vue-plus
+ com.ruoyi
+ 3.4.0
+
+ 4.0.0
+
+ ruoyi-common
+
+
+ common通用工具
+
+
+
+
+
+
+ org.springframework
+ spring-context-support
+
+
+
+
+ org.springframework
+ spring-web
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-security
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+
+
+ org.apache.commons
+ commons-lang3
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+
+
+ org.apache.poi
+ poi-ooxml
+
+
+
+ com.alibaba
+ easyexcel
+
+
+
+
+ org.yaml
+ snakeyaml
+
+
+
+
+ io.jsonwebtoken
+ jjwt
+
+
+
+
+ com.sun.xml.bind
+ jaxb-impl
+
+
+
+
+ javax.servlet
+ javax.servlet-api
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+
+
+ com.baomidou
+ mybatis-plus-extension
+
+
+ cn.hutool
+ hutool-all
+
+
+ org.projectlombok
+ lombok
+
+
+
+ de.codecentric
+ spring-boot-admin-starter-client
+
+
+
+ com.github.xiaoymin
+ knife4j-spring-boot-starter
+
+
+
+ io.swagger
+ swagger-annotations
+
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+
+
+
+
+ org.redisson
+ redisson-spring-boot-starter
+
+
+
+ com.baomidou
+ lock4j-redisson-spring-boot-starter
+
+
+
+ com.yomahub
+ tlog-spring-boot-configuration
+
+
+
+ com.yomahub
+ tlog-webroot
+
+
+
+
+
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java
new file mode 100644
index 00000000..feaa3f42
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java
@@ -0,0 +1,28 @@
+package com.ruoyi.common.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 数据权限过滤注解
+ *
+ * @author ruoyi
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface DataScope {
+ /**
+ * 部门表的别名
+ */
+ String deptAlias() default "";
+
+ /**
+ * 用户表的别名
+ */
+ String userAlias() default "";
+
+ /**
+ * 是否过滤用户权限
+ */
+ boolean isUser() default false;
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java
new file mode 100644
index 00000000..e7d2250a
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java
@@ -0,0 +1,23 @@
+package com.ruoyi.common.annotation;
+
+import com.ruoyi.common.enums.DataSourceType;
+
+import java.lang.annotation.*;
+
+/**
+ * 自定义多数据源切换注解
+ *
+ * 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准
+ *
+ * @author ruoyi
+ */
+@Target({ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@Inherited
+public @interface DataSource {
+ /**
+ * 切换数据源名称
+ */
+ DataSourceType value() default DataSourceType.MASTER;
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/ExcelDictFormat.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/ExcelDictFormat.java
new file mode 100644
index 00000000..400080ea
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/ExcelDictFormat.java
@@ -0,0 +1,30 @@
+package com.ruoyi.common.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 字典格式化
+ *
+ * @author Lion Li
+ */
+@Target({ElementType.FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+public @interface ExcelDictFormat {
+
+ /**
+ * 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
+ */
+ String dictType() default "";
+
+ /**
+ * 读取内容转表达式 (如: 0=男,1=女,2=未知)
+ */
+ String readConverterExp() default "";
+
+ /**
+ * 分隔符,读取字符串组内容
+ */
+ String separator() default ",";
+
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java
new file mode 100644
index 00000000..32c39a3b
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java
@@ -0,0 +1,41 @@
+package com.ruoyi.common.annotation;
+
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.enums.OperatorType;
+
+import java.lang.annotation.*;
+
+/**
+ * 自定义操作日志记录注解
+ *
+ * @author ruoyi
+ */
+@Target({ElementType.PARAMETER, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Log {
+ /**
+ * 模块
+ */
+ String title() default "";
+
+ /**
+ * 功能
+ */
+ BusinessType businessType() default BusinessType.OTHER;
+
+ /**
+ * 操作人类别
+ */
+ OperatorType operatorType() default OperatorType.MANAGE;
+
+ /**
+ * 是否保存请求的参数
+ */
+ boolean isSaveRequestData() default true;
+
+ /**
+ * 是否保存响应的参数
+ */
+ boolean isSaveResponseData() default true;
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java
new file mode 100644
index 00000000..23ca336f
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java
@@ -0,0 +1,36 @@
+package com.ruoyi.common.annotation;
+
+import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.enums.LimitType;
+
+import java.lang.annotation.*;
+
+/**
+ * 限流注解
+ *
+ * @author Lion Li
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface RateLimiter {
+ /**
+ * 限流key
+ */
+ String key() default Constants.RATE_LIMIT_KEY;
+
+ /**
+ * 限流时间,单位秒
+ */
+ int time() default 60;
+
+ /**
+ * 限流次数
+ */
+ int count() default 100;
+
+ /**
+ * 限流类型
+ */
+ LimitType limitType() default LimitType.DEFAULT;
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java
new file mode 100644
index 00000000..a8746676
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java
@@ -0,0 +1,29 @@
+package com.ruoyi.common.annotation;
+
+import java.lang.annotation.*;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 自定义注解防止表单重复提交
+ *
+ * @author Lion Li
+ */
+@Inherited
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface RepeatSubmit {
+
+ /**
+ * 间隔时间(ms),小于此时间视为重复提交
+ */
+ int interval() default 5000;
+
+ TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
+
+ /**
+ * 提示消息
+ */
+ String message() default "不允许重复提交,请稍候再试";
+
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/captcha/UnsignedMathGenerator.java b/ruoyi-common/src/main/java/com/ruoyi/common/captcha/UnsignedMathGenerator.java
new file mode 100644
index 00000000..9c0f26f5
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/captcha/UnsignedMathGenerator.java
@@ -0,0 +1,85 @@
+package com.ruoyi.common.captcha;
+
+import cn.hutool.captcha.generator.CodeGenerator;
+import cn.hutool.core.math.Calculator;
+import cn.hutool.core.util.CharUtil;
+import cn.hutool.core.util.RandomUtil;
+import com.ruoyi.common.utils.StringUtils;
+
+/**
+ * 无符号计算生成器
+ *
+ * @author Lion Li
+ */
+public class UnsignedMathGenerator implements CodeGenerator {
+
+ private static final long serialVersionUID = -5514819971774091076L;
+
+ private static final String operators = "+-*";
+
+ /**
+ * 参与计算数字最大长度
+ */
+ private final int numberLength;
+
+ /**
+ * 构造
+ */
+ public UnsignedMathGenerator() {
+ this(2);
+ }
+
+ /**
+ * 构造
+ *
+ * @param numberLength 参与计算最大数字位数
+ */
+ public UnsignedMathGenerator(int numberLength) {
+ this.numberLength = numberLength;
+ }
+
+ @Override
+ public String generate() {
+ final int limit = getLimit();
+ int min = RandomUtil.randomInt(limit);
+ int max = RandomUtil.randomInt(min, limit);
+ String number1 = Integer.toString(max);
+ String number2 = Integer.toString(min);
+ number1 = StringUtils.rightPad(number1, this.numberLength, CharUtil.SPACE);
+ number2 = StringUtils.rightPad(number2, this.numberLength, CharUtil.SPACE);
+
+ return number1 + RandomUtil.randomChar(operators) + number2 + '=';
+ }
+
+ @Override
+ public boolean verify(String code, String userInputCode) {
+ int result;
+ try {
+ result = Integer.parseInt(userInputCode);
+ } catch (NumberFormatException e) {
+ // 用户输入非数字
+ return false;
+ }
+
+ final int calculateResult = (int) Calculator.conversion(code);
+ return result == calculateResult;
+ }
+
+ /**
+ * 获取验证码长度
+ *
+ * @return 验证码长度
+ */
+ public int getLength() {
+ return this.numberLength * 2 + 2;
+ }
+
+ /**
+ * 根据长度获取参与计算数字最大值
+ *
+ * @return 最大值
+ */
+ private int getLimit() {
+ return Integer.parseInt("1" + StringUtils.repeat('0', this.numberLength));
+ }
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
new file mode 100644
index 00000000..bcfc677b
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
@@ -0,0 +1,56 @@
+package com.ruoyi.common.config;
+
+import lombok.Data;
+import lombok.Getter;
+import lombok.experimental.Accessors;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * 读取项目相关配置
+ *
+ * @author Lion Li
+ */
+
+@Data
+@Accessors(chain = true)
+@Component
+@ConfigurationProperties(prefix = "ruoyi")
+public class RuoYiConfig {
+
+ /**
+ * 项目名称
+ */
+ private String name;
+
+ /**
+ * 版本
+ */
+ private String version;
+
+ /**
+ * 版权年份
+ */
+ private String copyrightYear;
+
+ /**
+ * 实例演示开关
+ */
+ private boolean demoEnabled;
+
+ /**
+ * 缓存懒加载
+ */
+ private boolean cacheLazy;
+
+ /**
+ * 获取地址开关
+ */
+ @Getter
+ private static boolean addressEnabled;
+
+ public void setAddressEnabled(boolean addressEnabled) {
+ RuoYiConfig.addressEnabled = addressEnabled;
+ }
+
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
new file mode 100644
index 00000000..9c91a1a1
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
@@ -0,0 +1,136 @@
+package com.ruoyi.common.constant;
+
+import io.jsonwebtoken.Claims;
+
+/**
+ * 通用常量信息
+ *
+ * @author ruoyi
+ */
+public class Constants {
+ /**
+ * UTF-8 字符集
+ */
+ public static final String UTF8 = "UTF-8";
+
+ /**
+ * GBK 字符集
+ */
+ public static final String GBK = "GBK";
+
+ /**
+ * http请求
+ */
+ public static final String HTTP = "http://";
+
+ /**
+ * https请求
+ */
+ public static final String HTTPS = "https://";
+
+ /**
+ * 通用成功标识
+ */
+ public static final String SUCCESS = "0";
+
+ /**
+ * 通用失败标识
+ */
+ public static final String FAIL = "1";
+
+ /**
+ * 登录成功
+ */
+ public static final String LOGIN_SUCCESS = "Success";
+
+ /**
+ * 注销
+ */
+ public static final String LOGOUT = "Logout";
+
+ /**
+ * 注册
+ */
+ public static final String REGISTER = "Register";
+
+ /**
+ * 登录失败
+ */
+ public static final String LOGIN_FAIL = "Error";
+
+ /**
+ * 验证码 redis key
+ */
+ public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
+
+ /**
+ * 登录用户 redis key
+ */
+ public static final String LOGIN_TOKEN_KEY = "login_tokens:";
+
+ /**
+ * 防重提交 redis key
+ */
+ public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
+
+ /**
+ * 限流 redis key
+ */
+ public static final String RATE_LIMIT_KEY = "rate_limit:";
+
+ /**
+ * 验证码有效期(分钟)
+ */
+ public static final Integer CAPTCHA_EXPIRATION = 2;
+
+ /**
+ * 令牌
+ */
+ public static final String TOKEN = "token";
+
+ /**
+ * 令牌前缀
+ */
+ public static final String TOKEN_PREFIX = "Bearer ";
+
+ /**
+ * 令牌前缀
+ */
+ public static final String LOGIN_USER_KEY = "login_user_key";
+
+ /**
+ * 用户ID
+ */
+ public static final String JWT_USERID = "userid";
+
+ /**
+ * 用户名称
+ */
+ public static final String JWT_USERNAME = Claims.SUBJECT;
+
+ /**
+ * 用户头像
+ */
+ public static final String JWT_AVATAR = "avatar";
+
+ /**
+ * 创建时间
+ */
+ public static final String JWT_CREATED = "created";
+
+ /**
+ * 用户权限
+ */
+ public static final String JWT_AUTHORITIES = "authorities";
+
+ /**
+ * 参数管理 cache key
+ */
+ public static final String SYS_CONFIG_KEY = "sys_config:";
+
+ /**
+ * 字典管理 cache key
+ */
+ public static final String SYS_DICT_KEY = "sys_dict:";
+
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java
new file mode 100644
index 00000000..4d0a4e8a
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java
@@ -0,0 +1,188 @@
+package com.ruoyi.common.constant;
+
+/**
+ * 代码生成通用常量
+ *
+ * @author ruoyi
+ */
+public class GenConstants {
+ /**
+ * 单表(增删改查)
+ */
+ public static final String TPL_CRUD = "crud";
+
+ /**
+ * 树表(增删改查)
+ */
+ public static final String TPL_TREE = "tree";
+
+ /**
+ * 主子表(增删改查)
+ */
+ public static final String TPL_SUB = "sub";
+
+ /**
+ * 树编码字段
+ */
+ public static final String TREE_CODE = "treeCode";
+
+ /**
+ * 树父编码字段
+ */
+ public static final String TREE_PARENT_CODE = "treeParentCode";
+
+ /**
+ * 树名称字段
+ */
+ public static final String TREE_NAME = "treeName";
+
+ /**
+ * 上级菜单ID字段
+ */
+ public static final String PARENT_MENU_ID = "parentMenuId";
+
+ /**
+ * 上级菜单名称字段
+ */
+ public static final String PARENT_MENU_NAME = "parentMenuName";
+
+ /**
+ * 数据库字符串类型
+ */
+ public static final String[] COLUMNTYPE_STR = {"char", "varchar", "nvarchar", "varchar2"};
+
+ /**
+ * 数据库文本类型
+ */
+ public static final String[] COLUMNTYPE_TEXT = {"tinytext", "text", "mediumtext", "longtext"};
+
+ /**
+ * 数据库时间类型
+ */
+ public static final String[] COLUMNTYPE_TIME = {"datetime", "time", "date", "timestamp"};
+
+ /**
+ * 数据库数字类型
+ */
+ public static final String[] COLUMNTYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "number", "integer",
+ "bit", "bigint", "float", "double", "decimal"};
+
+ /**
+ * BO对象 不需要添加字段
+ */
+ public static final String[] COLUMNNAME_NOT_ADD = {"create_by", "create_time", "del_flag", "update_by",
+ "update_time", "version"};
+
+ /**
+ * BO对象 不需要编辑字段
+ */
+ public static final String[] COLUMNNAME_NOT_EDIT = {"create_by", "create_time", "del_flag", "update_by",
+ "update_time", "version"};
+
+ /**
+ * VO对象 不需要返回字段
+ */
+ public static final String[] COLUMNNAME_NOT_LIST = {"create_by", "create_time", "del_flag", "update_by",
+ "update_time", "version"};
+
+ /**
+ * BO对象 不需要查询字段
+ */
+ public static final String[] COLUMNNAME_NOT_QUERY = {"id", "create_by", "create_time", "del_flag", "update_by",
+ "update_time", "remark", "version"};
+
+ /**
+ * Entity基类字段
+ */
+ public static final String[] BASE_ENTITY = {"createBy", "createTime", "updateBy", "updateTime"};
+
+ /**
+ * Tree基类字段
+ */
+ public static final String[] TREE_ENTITY = {"parentName", "parentId", "children"};
+
+ /**
+ * 文本框
+ */
+ public static final String HTML_INPUT = "input";
+
+ /**
+ * 文本域
+ */
+ public static final String HTML_TEXTAREA = "textarea";
+
+ /**
+ * 下拉框
+ */
+ public static final String HTML_SELECT = "select";
+
+ /**
+ * 单选框
+ */
+ public static final String HTML_RADIO = "radio";
+
+ /**
+ * 复选框
+ */
+ public static final String HTML_CHECKBOX = "checkbox";
+
+ /**
+ * 日期控件
+ */
+ public static final String HTML_DATETIME = "datetime";
+
+ /**
+ * 图片上传控件
+ */
+ public static final String HTML_IMAGE_UPLOAD = "imageUpload";
+
+ /**
+ * 文件上传控件
+ */
+ public static final String HTML_FILE_UPLOAD = "fileUpload";
+
+ /**
+ * 富文本控件
+ */
+ public static final String HTML_EDITOR = "editor";
+
+ /**
+ * 字符串类型
+ */
+ public static final String TYPE_STRING = "String";
+
+ /**
+ * 整型
+ */
+ public static final String TYPE_INTEGER = "Integer";
+
+ /**
+ * 长整型
+ */
+ public static final String TYPE_LONG = "Long";
+
+ /**
+ * 浮点型
+ */
+ public static final String TYPE_DOUBLE = "Double";
+
+ /**
+ * 高精度计算类型
+ */
+ public static final String TYPE_BIGDECIMAL = "BigDecimal";
+
+ /**
+ * 时间类型
+ */
+ public static final String TYPE_DATE = "Date";
+
+ /**
+ * 模糊查询
+ */
+ public static final String QUERY_LIKE = "LIKE";
+
+ /**
+ * 需要
+ */
+ public static final String REQUIRE = "1";
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
new file mode 100644
index 00000000..fa88e7c1
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
@@ -0,0 +1,112 @@
+package com.ruoyi.common.constant;
+
+/**
+ * 用户常量信息
+ *
+ * @author ruoyi
+ */
+public class UserConstants {
+
+ /**
+ * 平台内系统用户的唯一标志
+ */
+ public static final String SYS_USER = "SYS_USER";
+
+ /**
+ * 正常状态
+ */
+ public static final String NORMAL = "0";
+
+ /**
+ * 异常状态
+ */
+ public static final String EXCEPTION = "1";
+
+ /**
+ * 用户封禁状态
+ */
+ public static final String USER_DISABLE = "1";
+
+ /**
+ * 角色封禁状态
+ */
+ public static final String ROLE_DISABLE = "1";
+
+ /**
+ * 部门正常状态
+ */
+ public static final String DEPT_NORMAL = "0";
+
+ /**
+ * 部门停用状态
+ */
+ public static final String DEPT_DISABLE = "1";
+
+ /**
+ * 字典正常状态
+ */
+ public static final String DICT_NORMAL = "0";
+
+ /**
+ * 是否为系统默认(是)
+ */
+ public static final String YES = "Y";
+
+ /**
+ * 是否菜单外链(是)
+ */
+ public static final String YES_FRAME = "0";
+
+ /**
+ * 是否菜单外链(否)
+ */
+ public static final String NO_FRAME = "1";
+
+ /**
+ * 菜单类型(目录)
+ */
+ public static final String TYPE_DIR = "M";
+
+ /**
+ * 菜单类型(菜单)
+ */
+ public static final String TYPE_MENU = "C";
+
+ /**
+ * 菜单类型(按钮)
+ */
+ public static final String TYPE_BUTTON = "F";
+
+ /**
+ * Layout组件标识
+ */
+ public final static String LAYOUT = "Layout";
+
+ /**
+ * ParentView组件标识
+ */
+ public final static String PARENT_VIEW = "ParentView";
+
+ /**
+ * InnerLink组件标识
+ */
+ public final static String INNER_LINK = "InnerLink";
+
+ /**
+ * 校验返回结果码
+ */
+ public final static String UNIQUE = "0";
+ public final static String NOT_UNIQUE = "1";
+
+ /**
+ * 用户名长度限制
+ */
+ public static final int USERNAME_MIN_LENGTH = 2;
+ public static final int USERNAME_MAX_LENGTH = 20;
+
+ /**
+ * 密码长度限制
+ */
+ public static final int PASSWORD_MIN_LENGTH = 5;
+ public static final int PASSWORD_MAX_LENGTH = 20;
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelBigNumberConvert.java b/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelBigNumberConvert.java
new file mode 100644
index 00000000..df1f95a0
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelBigNumberConvert.java
@@ -0,0 +1,51 @@
+package com.ruoyi.common.convert;
+
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.enums.CellDataTypeEnum;
+import com.alibaba.excel.metadata.CellData;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+import lombok.extern.slf4j.Slf4j;
+
+import java.math.BigDecimal;
+
+/**
+ * 大数值转换
+ * Excel 数值长度位15位 大于15位的数值转换位字符串
+ *
+ * @author Lion Li
+ */
+@Slf4j
+public class ExcelBigNumberConvert implements Converter {
+
+ @Override
+ public Class supportJavaTypeKey() {
+ return Long.class;
+ }
+
+ @Override
+ public CellDataTypeEnum supportExcelTypeKey() {
+ return CellDataTypeEnum.STRING;
+ }
+
+ @Override
+ public Long convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
+ return Convert.toLong(cellData.getData());
+ }
+
+ @Override
+ public CellData