├── .github
└── FUNDING.yml
├── .gitignore
├── LICENSE
├── README.md
├── bin
├── clean.bat
├── package.bat
└── run.bat
├── doc
└── 若依环境使用手册.docx
├── pom.xml
├── ruoyi-admin
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── ruoyi
│ │ ├── RuoYiApplication.java
│ │ ├── RuoYiServletInitializer.java
│ │ └── web
│ │ ├── controller
│ │ ├── common
│ │ │ ├── CaptchaController.java
│ │ │ └── CommonController.java
│ │ ├── monitor
│ │ │ ├── CacheController.java
│ │ │ ├── ServerController.java
│ │ │ ├── SysLogininforController.java
│ │ │ ├── SysOperlogController.java
│ │ │ └── SysUserOnlineController.java
│ │ ├── system
│ │ │ ├── SysConfigController.java
│ │ │ ├── SysDeptController.java
│ │ │ ├── SysDictDataController.java
│ │ │ ├── SysDictTypeController.java
│ │ │ ├── SysIndexController.java
│ │ │ ├── SysLoginController.java
│ │ │ ├── SysMenuController.java
│ │ │ ├── SysNoticeController.java
│ │ │ ├── SysPostController.java
│ │ │ ├── SysProfileController.java
│ │ │ ├── SysRegisterController.java
│ │ │ ├── SysRoleController.java
│ │ │ └── SysUserController.java
│ │ └── tool
│ │ │ └── TestController.java
│ │ └── core
│ │ └── config
│ │ └── SwaggerConfig.java
│ └── resources
│ ├── META-INF
│ └── spring-devtools.properties
│ ├── application-druid.yml
│ ├── application.yml
│ ├── banner.txt
│ ├── i18n
│ └── messages.properties
│ ├── logback.xml
│ └── mybatis
│ └── mybatis-config.xml
├── ruoyi-common
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── ruoyi
│ └── common
│ ├── annotation
│ ├── Anonymous.java
│ ├── DataScope.java
│ ├── DataSource.java
│ ├── Excel.java
│ ├── Excels.java
│ ├── Log.java
│ ├── RateLimiter.java
│ └── RepeatSubmit.java
│ ├── config
│ └── RuoYiConfig.java
│ ├── constant
│ ├── CacheConstants.java
│ ├── Constants.java
│ ├── GenConstants.java
│ ├── HttpStatus.java
│ ├── ScheduleConstants.java
│ └── UserConstants.java
│ ├── core
│ ├── controller
│ │ └── BaseController.java
│ ├── domain
│ │ ├── AjaxResult.java
│ │ ├── BaseEntity.java
│ │ ├── R.java
│ │ ├── TreeEntity.java
│ │ ├── TreeSelect.java
│ │ ├── entity
│ │ │ ├── SysDept.java
│ │ │ ├── SysDictData.java
│ │ │ ├── SysDictType.java
│ │ │ ├── SysMenu.java
│ │ │ ├── SysRole.java
│ │ │ └── SysUser.java
│ │ └── model
│ │ │ ├── LoginBody.java
│ │ │ ├── LoginUser.java
│ │ │ └── RegisterBody.java
│ ├── page
│ │ ├── PageDomain.java
│ │ ├── TableDataInfo.java
│ │ └── TableSupport.java
│ ├── redis
│ │ └── RedisCache.java
│ └── text
│ │ ├── CharsetKit.java
│ │ ├── Convert.java
│ │ └── StrFormatter.java
│ ├── enums
│ ├── BusinessStatus.java
│ ├── BusinessType.java
│ ├── DataSourceType.java
│ ├── HttpMethod.java
│ ├── LimitType.java
│ ├── OperatorType.java
│ └── UserStatus.java
│ ├── exception
│ ├── DemoModeException.java
│ ├── GlobalException.java
│ ├── ServiceException.java
│ ├── UtilException.java
│ ├── base
│ │ └── BaseException.java
│ ├── file
│ │ ├── FileException.java
│ │ ├── FileNameLengthLimitExceededException.java
│ │ ├── FileSizeLimitExceededException.java
│ │ ├── FileUploadException.java
│ │ └── InvalidExtensionException.java
│ ├── job
│ │ └── TaskException.java
│ └── user
│ │ ├── BlackListException.java
│ │ ├── CaptchaException.java
│ │ ├── CaptchaExpireException.java
│ │ ├── UserException.java
│ │ ├── UserNotExistsException.java
│ │ ├── UserPasswordNotMatchException.java
│ │ └── UserPasswordRetryLimitExceedException.java
│ ├── filter
│ ├── PropertyPreExcludeFilter.java
│ ├── RepeatableFilter.java
│ ├── RepeatedlyRequestWrapper.java
│ ├── XssFilter.java
│ └── XssHttpServletRequestWrapper.java
│ ├── utils
│ ├── Arith.java
│ ├── DateUtils.java
│ ├── DictUtils.java
│ ├── ExceptionUtil.java
│ ├── LogUtils.java
│ ├── MessageUtils.java
│ ├── PageUtils.java
│ ├── SecurityUtils.java
│ ├── ServletUtils.java
│ ├── StringUtils.java
│ ├── Threads.java
│ ├── bean
│ │ ├── BeanUtils.java
│ │ └── BeanValidators.java
│ ├── file
│ │ ├── FileTypeUtils.java
│ │ ├── FileUploadUtils.java
│ │ ├── FileUtils.java
│ │ ├── ImageUtils.java
│ │ └── MimeTypeUtils.java
│ ├── html
│ │ ├── EscapeUtil.java
│ │ └── HTMLFilter.java
│ ├── http
│ │ ├── HttpHelper.java
│ │ └── HttpUtils.java
│ ├── ip
│ │ ├── AddressUtils.java
│ │ └── IpUtils.java
│ ├── poi
│ │ ├── ExcelHandlerAdapter.java
│ │ └── ExcelUtil.java
│ ├── reflect
│ │ └── ReflectUtils.java
│ ├── sign
│ │ ├── Base64.java
│ │ └── Md5Utils.java
│ ├── spring
│ │ └── SpringUtils.java
│ ├── sql
│ │ └── SqlUtil.java
│ └── uuid
│ │ ├── IdUtils.java
│ │ ├── Seq.java
│ │ └── UUID.java
│ └── xss
│ ├── Xss.java
│ └── XssValidator.java
├── ruoyi-framework
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── ruoyi
│ └── framework
│ ├── aspectj
│ ├── DataScopeAspect.java
│ ├── DataSourceAspect.java
│ ├── LogAspect.java
│ └── RateLimiterAspect.java
│ ├── config
│ ├── ApplicationConfig.java
│ ├── CaptchaConfig.java
│ ├── DruidConfig.java
│ ├── FastJson2JsonRedisSerializer.java
│ ├── FilterConfig.java
│ ├── KaptchaTextCreator.java
│ ├── MyBatisConfig.java
│ ├── RedisConfig.java
│ ├── ResourcesConfig.java
│ ├── SecurityConfig.java
│ ├── ServerConfig.java
│ ├── ThreadPoolConfig.java
│ └── properties
│ │ ├── DruidProperties.java
│ │ └── PermitAllUrlProperties.java
│ ├── datasource
│ ├── DynamicDataSource.java
│ └── DynamicDataSourceContextHolder.java
│ ├── interceptor
│ ├── RepeatSubmitInterceptor.java
│ └── impl
│ │ └── SameUrlDataInterceptor.java
│ ├── manager
│ ├── AsyncManager.java
│ ├── ShutdownManager.java
│ └── factory
│ │ └── AsyncFactory.java
│ ├── security
│ ├── context
│ │ ├── AuthenticationContextHolder.java
│ │ └── PermissionContextHolder.java
│ ├── filter
│ │ └── JwtAuthenticationTokenFilter.java
│ └── handle
│ │ ├── AuthenticationEntryPointImpl.java
│ │ └── LogoutSuccessHandlerImpl.java
│ └── web
│ ├── domain
│ ├── Server.java
│ └── server
│ │ ├── Cpu.java
│ │ ├── Jvm.java
│ │ ├── Mem.java
│ │ ├── Sys.java
│ │ └── SysFile.java
│ ├── exception
│ └── GlobalExceptionHandler.java
│ └── service
│ ├── PermissionService.java
│ ├── SysLoginService.java
│ ├── SysPasswordService.java
│ ├── SysPermissionService.java
│ ├── SysRegisterService.java
│ ├── TokenService.java
│ └── UserDetailsServiceImpl.java
├── ruoyi-generator
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── ruoyi
│ │ └── generator
│ │ ├── config
│ │ └── GenConfig.java
│ │ ├── controller
│ │ └── GenController.java
│ │ ├── domain
│ │ ├── GenTable.java
│ │ └── GenTableColumn.java
│ │ ├── mapper
│ │ ├── GenTableColumnMapper.java
│ │ └── GenTableMapper.java
│ │ ├── service
│ │ ├── GenTableColumnServiceImpl.java
│ │ ├── GenTableServiceImpl.java
│ │ ├── IGenTableColumnService.java
│ │ └── IGenTableService.java
│ │ └── util
│ │ ├── GenUtils.java
│ │ ├── VelocityInitializer.java
│ │ └── VelocityUtils.java
│ └── resources
│ ├── generator.yml
│ ├── mapper
│ └── generator
│ │ ├── GenTableColumnMapper.xml
│ │ └── GenTableMapper.xml
│ └── vm
│ ├── java
│ ├── controller.java.vm
│ ├── domain.java.vm
│ ├── mapper.java.vm
│ ├── service.java.vm
│ ├── serviceImpl.java.vm
│ └── sub-domain.java.vm
│ ├── js
│ └── api.js.vm
│ ├── sql
│ └── sql.vm
│ ├── vue
│ ├── index-tree.vue.vm
│ ├── index.vue.vm
│ └── v3
│ │ ├── index-tree.vue.vm
│ │ └── index.vue.vm
│ └── xml
│ └── mapper.xml.vm
├── ruoyi-quartz
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── ruoyi
│ │ └── quartz
│ │ ├── config
│ │ └── ScheduleConfig.java
│ │ ├── controller
│ │ ├── SysJobController.java
│ │ └── SysJobLogController.java
│ │ ├── domain
│ │ ├── SysJob.java
│ │ └── SysJobLog.java
│ │ ├── mapper
│ │ ├── SysJobLogMapper.java
│ │ └── SysJobMapper.java
│ │ ├── service
│ │ ├── ISysJobLogService.java
│ │ ├── ISysJobService.java
│ │ └── impl
│ │ │ ├── SysJobLogServiceImpl.java
│ │ │ └── SysJobServiceImpl.java
│ │ ├── task
│ │ └── RyTask.java
│ │ └── util
│ │ ├── AbstractQuartzJob.java
│ │ ├── CronUtils.java
│ │ ├── JobInvokeUtil.java
│ │ ├── QuartzDisallowConcurrentExecution.java
│ │ ├── QuartzJobExecution.java
│ │ └── ScheduleUtils.java
│ └── resources
│ └── mapper
│ └── quartz
│ ├── SysJobLogMapper.xml
│ └── SysJobMapper.xml
├── ruoyi-system
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── ruoyi
│ │ └── system
│ │ ├── domain
│ │ ├── SysCache.java
│ │ ├── SysConfig.java
│ │ ├── SysLogininfor.java
│ │ ├── SysNotice.java
│ │ ├── SysOperLog.java
│ │ ├── SysPost.java
│ │ ├── SysRoleDept.java
│ │ ├── SysRoleMenu.java
│ │ ├── SysUserOnline.java
│ │ ├── SysUserPost.java
│ │ ├── SysUserRole.java
│ │ └── vo
│ │ │ ├── MetaVo.java
│ │ │ └── RouterVo.java
│ │ ├── mapper
│ │ ├── SysConfigMapper.java
│ │ ├── SysDeptMapper.java
│ │ ├── SysDictDataMapper.java
│ │ ├── SysDictTypeMapper.java
│ │ ├── SysLogininforMapper.java
│ │ ├── SysMenuMapper.java
│ │ ├── SysNoticeMapper.java
│ │ ├── SysOperLogMapper.java
│ │ ├── SysPostMapper.java
│ │ ├── SysRoleDeptMapper.java
│ │ ├── SysRoleMapper.java
│ │ ├── SysRoleMenuMapper.java
│ │ ├── SysUserMapper.java
│ │ ├── SysUserPostMapper.java
│ │ └── SysUserRoleMapper.java
│ │ └── service
│ │ ├── ISysConfigService.java
│ │ ├── ISysDeptService.java
│ │ ├── ISysDictDataService.java
│ │ ├── ISysDictTypeService.java
│ │ ├── ISysLogininforService.java
│ │ ├── ISysMenuService.java
│ │ ├── ISysNoticeService.java
│ │ ├── ISysOperLogService.java
│ │ ├── ISysPostService.java
│ │ ├── ISysRoleService.java
│ │ ├── ISysUserOnlineService.java
│ │ ├── ISysUserService.java
│ │ └── impl
│ │ ├── SysConfigServiceImpl.java
│ │ ├── SysDeptServiceImpl.java
│ │ ├── SysDictDataServiceImpl.java
│ │ ├── SysDictTypeServiceImpl.java
│ │ ├── SysLogininforServiceImpl.java
│ │ ├── SysMenuServiceImpl.java
│ │ ├── SysNoticeServiceImpl.java
│ │ ├── SysOperLogServiceImpl.java
│ │ ├── SysPostServiceImpl.java
│ │ ├── SysRoleServiceImpl.java
│ │ ├── SysUserOnlineServiceImpl.java
│ │ └── SysUserServiceImpl.java
│ └── resources
│ └── mapper
│ └── system
│ ├── SysConfigMapper.xml
│ ├── SysDeptMapper.xml
│ ├── SysDictDataMapper.xml
│ ├── SysDictTypeMapper.xml
│ ├── SysLogininforMapper.xml
│ ├── SysMenuMapper.xml
│ ├── SysNoticeMapper.xml
│ ├── SysOperLogMapper.xml
│ ├── SysPostMapper.xml
│ ├── SysRoleDeptMapper.xml
│ ├── SysRoleMapper.xml
│ ├── SysRoleMenuMapper.xml
│ ├── SysUserMapper.xml
│ ├── SysUserPostMapper.xml
│ └── SysUserRoleMapper.xml
├── ruoyi-ui
├── .editorconfig
├── .env.development
├── .env.production
├── .env.staging
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── README.md
├── babel.config.js
├── bin
│ ├── build.bat
│ ├── package.bat
│ └── run-web.bat
├── build
│ └── index.js
├── package.json
├── public
│ ├── favicon.ico
│ ├── html
│ │ └── ie.html
│ ├── index.html
│ └── robots.txt
├── src
│ ├── App.vue
│ ├── api
│ │ ├── login.js
│ │ ├── menu.js
│ │ ├── monitor
│ │ │ ├── cache.js
│ │ │ ├── job.js
│ │ │ ├── jobLog.js
│ │ │ ├── logininfor.js
│ │ │ ├── online.js
│ │ │ ├── operlog.js
│ │ │ └── server.js
│ │ ├── system
│ │ │ ├── config.js
│ │ │ ├── dept.js
│ │ │ ├── dict
│ │ │ │ ├── data.js
│ │ │ │ └── type.js
│ │ │ ├── menu.js
│ │ │ ├── notice.js
│ │ │ ├── post.js
│ │ │ ├── role.js
│ │ │ └── user.js
│ │ └── tool
│ │ │ └── gen.js
│ ├── assets
│ │ ├── 401_images
│ │ │ └── 401.gif
│ │ ├── 404_images
│ │ │ ├── 404.png
│ │ │ └── 404_cloud.png
│ │ ├── icons
│ │ │ ├── index.js
│ │ │ ├── svg
│ │ │ │ ├── 404.svg
│ │ │ │ ├── bug.svg
│ │ │ │ ├── build.svg
│ │ │ │ ├── button.svg
│ │ │ │ ├── cascader.svg
│ │ │ │ ├── chart.svg
│ │ │ │ ├── checkbox.svg
│ │ │ │ ├── clipboard.svg
│ │ │ │ ├── code.svg
│ │ │ │ ├── color.svg
│ │ │ │ ├── component.svg
│ │ │ │ ├── dashboard.svg
│ │ │ │ ├── date-range.svg
│ │ │ │ ├── date.svg
│ │ │ │ ├── dict.svg
│ │ │ │ ├── documentation.svg
│ │ │ │ ├── download.svg
│ │ │ │ ├── drag.svg
│ │ │ │ ├── druid.svg
│ │ │ │ ├── edit.svg
│ │ │ │ ├── education.svg
│ │ │ │ ├── email.svg
│ │ │ │ ├── example.svg
│ │ │ │ ├── excel.svg
│ │ │ │ ├── exit-fullscreen.svg
│ │ │ │ ├── eye-open.svg
│ │ │ │ ├── eye.svg
│ │ │ │ ├── form.svg
│ │ │ │ ├── fullscreen.svg
│ │ │ │ ├── github.svg
│ │ │ │ ├── guide.svg
│ │ │ │ ├── icon.svg
│ │ │ │ ├── input.svg
│ │ │ │ ├── international.svg
│ │ │ │ ├── job.svg
│ │ │ │ ├── language.svg
│ │ │ │ ├── link.svg
│ │ │ │ ├── list.svg
│ │ │ │ ├── lock.svg
│ │ │ │ ├── log.svg
│ │ │ │ ├── logininfor.svg
│ │ │ │ ├── message.svg
│ │ │ │ ├── money.svg
│ │ │ │ ├── monitor.svg
│ │ │ │ ├── nested.svg
│ │ │ │ ├── number.svg
│ │ │ │ ├── online.svg
│ │ │ │ ├── password.svg
│ │ │ │ ├── pdf.svg
│ │ │ │ ├── people.svg
│ │ │ │ ├── peoples.svg
│ │ │ │ ├── phone.svg
│ │ │ │ ├── post.svg
│ │ │ │ ├── qq.svg
│ │ │ │ ├── question.svg
│ │ │ │ ├── radio.svg
│ │ │ │ ├── rate.svg
│ │ │ │ ├── redis-list.svg
│ │ │ │ ├── redis.svg
│ │ │ │ ├── row.svg
│ │ │ │ ├── search.svg
│ │ │ │ ├── select.svg
│ │ │ │ ├── server.svg
│ │ │ │ ├── shopping.svg
│ │ │ │ ├── size.svg
│ │ │ │ ├── skill.svg
│ │ │ │ ├── slider.svg
│ │ │ │ ├── star.svg
│ │ │ │ ├── swagger.svg
│ │ │ │ ├── switch.svg
│ │ │ │ ├── system.svg
│ │ │ │ ├── tab.svg
│ │ │ │ ├── table.svg
│ │ │ │ ├── textarea.svg
│ │ │ │ ├── theme.svg
│ │ │ │ ├── time-range.svg
│ │ │ │ ├── time.svg
│ │ │ │ ├── tool.svg
│ │ │ │ ├── tree-table.svg
│ │ │ │ ├── tree.svg
│ │ │ │ ├── upload.svg
│ │ │ │ ├── user.svg
│ │ │ │ ├── validCode.svg
│ │ │ │ ├── wechat.svg
│ │ │ │ └── zip.svg
│ │ │ └── svgo.yml
│ │ ├── images
│ │ │ ├── dark.svg
│ │ │ ├── light.svg
│ │ │ ├── login-background.jpg
│ │ │ ├── pay.png
│ │ │ └── profile.jpg
│ │ ├── logo
│ │ │ └── logo.png
│ │ └── styles
│ │ │ ├── btn.scss
│ │ │ ├── element-ui.scss
│ │ │ ├── element-variables.scss
│ │ │ ├── index.scss
│ │ │ ├── mixin.scss
│ │ │ ├── ruoyi.scss
│ │ │ ├── sidebar.scss
│ │ │ ├── transition.scss
│ │ │ └── variables.scss
│ ├── components
│ │ ├── Breadcrumb
│ │ │ └── index.vue
│ │ ├── Crontab
│ │ │ ├── day.vue
│ │ │ ├── hour.vue
│ │ │ ├── index.vue
│ │ │ ├── min.vue
│ │ │ ├── month.vue
│ │ │ ├── result.vue
│ │ │ ├── second.vue
│ │ │ ├── week.vue
│ │ │ └── year.vue
│ │ ├── DictData
│ │ │ └── index.js
│ │ ├── DictTag
│ │ │ └── index.vue
│ │ ├── Editor
│ │ │ └── index.vue
│ │ ├── FileUpload
│ │ │ └── index.vue
│ │ ├── Hamburger
│ │ │ └── index.vue
│ │ ├── HeaderSearch
│ │ │ └── index.vue
│ │ ├── IconSelect
│ │ │ ├── index.vue
│ │ │ └── requireIcons.js
│ │ ├── ImagePreview
│ │ │ └── index.vue
│ │ ├── ImageUpload
│ │ │ └── index.vue
│ │ ├── Pagination
│ │ │ └── index.vue
│ │ ├── PanThumb
│ │ │ └── index.vue
│ │ ├── ParentView
│ │ │ └── index.vue
│ │ ├── RightPanel
│ │ │ └── index.vue
│ │ ├── RightToolbar
│ │ │ └── index.vue
│ │ ├── RuoYi
│ │ │ ├── Doc
│ │ │ │ └── index.vue
│ │ │ └── Git
│ │ │ │ └── index.vue
│ │ ├── Screenfull
│ │ │ └── index.vue
│ │ ├── SizeSelect
│ │ │ └── index.vue
│ │ ├── SvgIcon
│ │ │ └── index.vue
│ │ ├── ThemePicker
│ │ │ └── index.vue
│ │ ├── TopNav
│ │ │ └── index.vue
│ │ └── iFrame
│ │ │ └── index.vue
│ ├── directive
│ │ ├── dialog
│ │ │ ├── drag.js
│ │ │ ├── dragHeight.js
│ │ │ └── dragWidth.js
│ │ ├── index.js
│ │ ├── module
│ │ │ └── clipboard.js
│ │ └── permission
│ │ │ ├── hasPermi.js
│ │ │ └── hasRole.js
│ ├── layout
│ │ ├── components
│ │ │ ├── AppMain.vue
│ │ │ ├── IframeToggle
│ │ │ │ └── index.vue
│ │ │ ├── InnerLink
│ │ │ │ └── index.vue
│ │ │ ├── Navbar.vue
│ │ │ ├── Settings
│ │ │ │ └── index.vue
│ │ │ ├── Sidebar
│ │ │ │ ├── FixiOSBug.js
│ │ │ │ ├── Item.vue
│ │ │ │ ├── Link.vue
│ │ │ │ ├── Logo.vue
│ │ │ │ ├── SidebarItem.vue
│ │ │ │ └── index.vue
│ │ │ ├── TagsView
│ │ │ │ ├── ScrollPane.vue
│ │ │ │ └── index.vue
│ │ │ └── index.js
│ │ ├── index.vue
│ │ └── mixin
│ │ │ └── ResizeHandler.js
│ ├── main.js
│ ├── permission.js
│ ├── plugins
│ │ ├── auth.js
│ │ ├── cache.js
│ │ ├── download.js
│ │ ├── index.js
│ │ ├── modal.js
│ │ └── tab.js
│ ├── router
│ │ └── index.js
│ ├── settings.js
│ ├── store
│ │ ├── getters.js
│ │ ├── index.js
│ │ └── modules
│ │ │ ├── app.js
│ │ │ ├── dict.js
│ │ │ ├── permission.js
│ │ │ ├── settings.js
│ │ │ ├── tagsView.js
│ │ │ └── user.js
│ ├── utils
│ │ ├── auth.js
│ │ ├── dict
│ │ │ ├── Dict.js
│ │ │ ├── DictConverter.js
│ │ │ ├── DictData.js
│ │ │ ├── DictMeta.js
│ │ │ ├── DictOptions.js
│ │ │ └── index.js
│ │ ├── errorCode.js
│ │ ├── generator
│ │ │ ├── config.js
│ │ │ ├── css.js
│ │ │ ├── drawingDefault.js
│ │ │ ├── html.js
│ │ │ ├── icon.json
│ │ │ ├── js.js
│ │ │ └── render.js
│ │ ├── index.js
│ │ ├── jsencrypt.js
│ │ ├── permission.js
│ │ ├── request.js
│ │ ├── ruoyi.js
│ │ ├── scroll-to.js
│ │ └── validate.js
│ └── views
│ │ ├── dashboard
│ │ ├── BarChart.vue
│ │ ├── LineChart.vue
│ │ ├── PanelGroup.vue
│ │ ├── PieChart.vue
│ │ ├── RaddarChart.vue
│ │ └── mixins
│ │ │ └── resize.js
│ │ ├── error
│ │ ├── 401.vue
│ │ └── 404.vue
│ │ ├── index.vue
│ │ ├── index_v1.vue
│ │ ├── login.vue
│ │ ├── monitor
│ │ ├── cache
│ │ │ ├── index.vue
│ │ │ └── list.vue
│ │ ├── druid
│ │ │ └── index.vue
│ │ ├── job
│ │ │ ├── index.vue
│ │ │ └── log.vue
│ │ ├── logininfor
│ │ │ └── index.vue
│ │ ├── online
│ │ │ └── index.vue
│ │ ├── operlog
│ │ │ └── index.vue
│ │ └── server
│ │ │ └── index.vue
│ │ ├── redirect.vue
│ │ ├── register.vue
│ │ ├── system
│ │ ├── config
│ │ │ └── index.vue
│ │ ├── dept
│ │ │ └── index.vue
│ │ ├── dict
│ │ │ ├── data.vue
│ │ │ └── index.vue
│ │ ├── menu
│ │ │ └── index.vue
│ │ ├── notice
│ │ │ └── index.vue
│ │ ├── post
│ │ │ └── index.vue
│ │ ├── role
│ │ │ ├── authUser.vue
│ │ │ ├── index.vue
│ │ │ └── selectUser.vue
│ │ └── user
│ │ │ ├── authRole.vue
│ │ │ ├── index.vue
│ │ │ └── profile
│ │ │ ├── index.vue
│ │ │ ├── resetPwd.vue
│ │ │ ├── userAvatar.vue
│ │ │ └── userInfo.vue
│ │ └── tool
│ │ ├── build
│ │ ├── CodeTypeDialog.vue
│ │ ├── DraggableItem.vue
│ │ ├── IconsDialog.vue
│ │ ├── RightPanel.vue
│ │ ├── TreeNodeDialog.vue
│ │ └── index.vue
│ │ ├── gen
│ │ ├── basicInfoForm.vue
│ │ ├── createTable.vue
│ │ ├── editTable.vue
│ │ ├── genInfoForm.vue
│ │ ├── importTable.vue
│ │ └── index.vue
│ │ └── swagger
│ │ └── index.vue
└── vue.config.js
├── ry.bat
├── ry.sh
└── sql
├── quartz.sql
└── ry_20231130.sql
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | custom: http://doc.ruoyi.vip/ruoyi-vue/other/donate.html
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ######################################################################
2 | # Build Tools
3 |
4 | .gradle
5 | /build/
6 | !gradle/wrapper/gradle-wrapper.jar
7 |
8 | target/
9 | !.mvn/wrapper/maven-wrapper.jar
10 |
11 | ######################################################################
12 | # IDE
13 |
14 | ### STS ###
15 | .apt_generated
16 | .classpath
17 | .factorypath
18 | .project
19 | .settings
20 | .springBeans
21 |
22 | ### IntelliJ IDEA ###
23 | .idea
24 | *.iws
25 | *.iml
26 | *.ipr
27 |
28 | ### JRebel ###
29 | rebel.xml
30 |
31 | ### NetBeans ###
32 | nbproject/private/
33 | build/*
34 | nbbuild/
35 | dist/
36 | nbdist/
37 | .nb-gradle/
38 |
39 | ######################################################################
40 | # Others
41 | *.log
42 | *.xml.versionsBackup
43 | *.swp
44 |
45 | !*/build/*.java
46 | !*/build/*.html
47 | !*/build/*.xml
48 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 RuoYi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/bin/clean.bat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StormyTech317/AdminPanel_Vue/af8e7144e2aab225b2f383748c1c33b8859c3e53/bin/clean.bat
--------------------------------------------------------------------------------
/bin/package.bat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StormyTech317/AdminPanel_Vue/af8e7144e2aab225b2f383748c1c33b8859c3e53/bin/package.bat
--------------------------------------------------------------------------------
/bin/run.bat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StormyTech317/AdminPanel_Vue/af8e7144e2aab225b2f383748c1c33b8859c3e53/bin/run.bat
--------------------------------------------------------------------------------
/doc/若依环境使用手册.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StormyTech317/AdminPanel_Vue/af8e7144e2aab225b2f383748c1c33b8859c3e53/doc/若依环境使用手册.docx
--------------------------------------------------------------------------------
/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
6 |
7 | /**
8 | * 启动程序
9 | *
10 | * @author ruoyi
11 | */
12 | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
13 | public class RuoYiApplication
14 | {
15 | public static void main(String[] args)
16 | {
17 | // System.setProperty("spring.devtools.restart.enabled", "false");
18 | SpringApplication.run(RuoYiApplication.class, args);
19 | System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
20 | " .-------. ____ __ \n" +
21 | " | _ _ \\ \\ \\ / / \n" +
22 | " | ( ' ) | \\ _. / ' \n" +
23 | " |(_ o _) / _( )_ .' \n" +
24 | " | (_,_).' __ ___(_ o _)' \n" +
25 | " | |\\ \\ | || |(_,_)' \n" +
26 | " | | \\ `' /| `-' / \n" +
27 | " | | \\ / \\ / \n" +
28 | " ''-' `'-' `-..-' ");
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi;
2 |
3 | import org.springframework.boot.builder.SpringApplicationBuilder;
4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
5 |
6 | /**
7 | * web容器中进行部署
8 | *
9 | * @author ruoyi
10 | */
11 | public class RuoYiServletInitializer extends SpringBootServletInitializer
12 | {
13 | @Override
14 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
15 | {
16 | return application.sources(RuoYiApplication.class);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.web.controller.monitor;
2 |
3 | import org.springframework.security.access.prepost.PreAuthorize;
4 | import org.springframework.web.bind.annotation.GetMapping;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RestController;
7 | import com.ruoyi.common.core.domain.AjaxResult;
8 | import com.ruoyi.framework.web.domain.Server;
9 |
10 | /**
11 | * 服务器监控
12 | *
13 | * @author ruoyi
14 | */
15 | @RestController
16 | @RequestMapping("/monitor/server")
17 | public class ServerController
18 | {
19 | @PreAuthorize("@ss.hasPermi('monitor:server:list')")
20 | @GetMapping()
21 | public AjaxResult getInfo() throws Exception
22 | {
23 | Server server = new Server();
24 | server.copyTo();
25 | return AjaxResult.success(server);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.web.controller.system;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.web.bind.annotation.RequestMapping;
5 | import org.springframework.web.bind.annotation.RestController;
6 | import com.ruoyi.common.config.RuoYiConfig;
7 | import com.ruoyi.common.utils.StringUtils;
8 |
9 | /**
10 | * 首页
11 | *
12 | * @author ruoyi
13 | */
14 | @RestController
15 | public class SysIndexController
16 | {
17 | /** 系统基础配置 */
18 | @Autowired
19 | private RuoYiConfig ruoyiConfig;
20 |
21 | /**
22 | * 访问首页,提示语
23 | */
24 | @RequestMapping("/")
25 | public String index()
26 | {
27 | return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.web.controller.system;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.web.bind.annotation.PostMapping;
5 | import org.springframework.web.bind.annotation.RequestBody;
6 | import org.springframework.web.bind.annotation.RestController;
7 | import com.ruoyi.common.core.controller.BaseController;
8 | import com.ruoyi.common.core.domain.AjaxResult;
9 | import com.ruoyi.common.core.domain.model.RegisterBody;
10 | import com.ruoyi.common.utils.StringUtils;
11 | import com.ruoyi.framework.web.service.SysRegisterService;
12 | import com.ruoyi.system.service.ISysConfigService;
13 |
14 | /**
15 | * 注册验证
16 | *
17 | * @author ruoyi
18 | */
19 | @RestController
20 | public class SysRegisterController extends BaseController
21 | {
22 | @Autowired
23 | private SysRegisterService registerService;
24 |
25 | @Autowired
26 | private ISysConfigService configService;
27 |
28 | @PostMapping("/register")
29 | public AjaxResult register(@RequestBody RegisterBody user)
30 | {
31 | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
32 | {
33 | return error("当前系统没有开启注册功能!");
34 | }
35 | String msg = registerService.register(user);
36 | return StringUtils.isEmpty(msg) ? success() : error(msg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties:
--------------------------------------------------------------------------------
1 | restart.include.json=/com.alibaba.fastjson2.*.jar
--------------------------------------------------------------------------------
/ruoyi-admin/src/main/resources/i18n/messages.properties:
--------------------------------------------------------------------------------
1 | #错误消息
2 | not.null=* 必须填写
3 | user.jcaptcha.error=验证码错误
4 | user.jcaptcha.expire=验证码已失效
5 | user.not.exists=用户不存在/密码错误
6 | user.password.not.match=用户不存在/密码错误
7 | user.password.retry.limit.count=密码输入错误{0}次
8 | user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
9 | user.password.delete=对不起,您的账号已被删除
10 | user.blocked=用户已封禁,请联系管理员
11 | role.blocked=角色已封禁,请联系管理员
12 | login.blocked=很遗憾,访问IP已被列入系统黑名单
13 | user.logout.success=退出成功
14 |
15 | length.not.valid=长度必须在{min}到{max}个字符之间
16 |
17 | user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
18 | user.password.not.valid=* 5-50个字符
19 |
20 | user.email.not.valid=邮箱格式错误
21 | user.mobile.phone.number.not.valid=手机号格式错误
22 | user.login.success=登录成功
23 | user.register.success=注册成功
24 | user.notfound=请重新登录
25 | user.forcelogout=管理员强制退出,请重新登录
26 | user.unknown.error=未知错误,请重新登录
27 |
28 | ##文件上传消息
29 | upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB!
30 | upload.filename.exceed.length=上传的文件名最长{0}个字符
31 |
32 | ##权限
33 | no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
34 | no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
35 | no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
36 | no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
37 | no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
38 | no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
39 |
--------------------------------------------------------------------------------
/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Anonymous.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | /**
10 | * 匿名访问不鉴权注解
11 | *
12 | * @author ruoyi
13 | */
14 | @Target({ ElementType.METHOD, ElementType.TYPE })
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Documented
17 | public @interface Anonymous
18 | {
19 | }
20 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | /**
10 | * 数据权限过滤注解
11 | *
12 | * @author ruoyi
13 | */
14 | @Target(ElementType.METHOD)
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Documented
17 | public @interface DataScope
18 | {
19 | /**
20 | * 部门表的别名
21 | */
22 | public String deptAlias() default "";
23 |
24 | /**
25 | * 用户表的别名
26 | */
27 | public String userAlias() default "";
28 |
29 | /**
30 | * 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@ss获取,多个权限用逗号分隔开来
31 | */
32 | public String permission() default "";
33 | }
34 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Inherited;
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 | import java.lang.annotation.Target;
9 | import com.ruoyi.common.enums.DataSourceType;
10 |
11 | /**
12 | * 自定义多数据源切换注解
13 | *
14 | * 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准
15 | *
16 | * @author ruoyi
17 | */
18 | @Target({ ElementType.METHOD, ElementType.TYPE })
19 | @Retention(RetentionPolicy.RUNTIME)
20 | @Documented
21 | @Inherited
22 | public @interface DataSource
23 | {
24 | /**
25 | * 切换数据源名称
26 | */
27 | public DataSourceType value() default DataSourceType.MASTER;
28 | }
29 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * Excel注解集
10 | *
11 | * @author ruoyi
12 | */
13 | @Target(ElementType.FIELD)
14 | @Retention(RetentionPolicy.RUNTIME)
15 | public @interface Excels
16 | {
17 | public Excel[] value();
18 | }
19 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import com.ruoyi.common.enums.BusinessType;
9 | import com.ruoyi.common.enums.OperatorType;
10 |
11 | /**
12 | * 自定义操作日志记录注解
13 | *
14 | * @author ruoyi
15 | *
16 | */
17 | @Target({ ElementType.PARAMETER, ElementType.METHOD })
18 | @Retention(RetentionPolicy.RUNTIME)
19 | @Documented
20 | public @interface Log
21 | {
22 | /**
23 | * 模块
24 | */
25 | public String title() default "";
26 |
27 | /**
28 | * 功能
29 | */
30 | public BusinessType businessType() default BusinessType.OTHER;
31 |
32 | /**
33 | * 操作人类别
34 | */
35 | public OperatorType operatorType() default OperatorType.MANAGE;
36 |
37 | /**
38 | * 是否保存请求的参数
39 | */
40 | public boolean isSaveRequestData() default true;
41 |
42 | /**
43 | * 是否保存响应的参数
44 | */
45 | public boolean isSaveResponseData() default true;
46 |
47 | /**
48 | * 排除指定的请求参数
49 | */
50 | public String[] excludeParamNames() default {};
51 | }
52 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import com.ruoyi.common.constant.CacheConstants;
9 | import com.ruoyi.common.enums.LimitType;
10 |
11 | /**
12 | * 限流注解
13 | *
14 | * @author ruoyi
15 | */
16 | @Target(ElementType.METHOD)
17 | @Retention(RetentionPolicy.RUNTIME)
18 | @Documented
19 | public @interface RateLimiter
20 | {
21 | /**
22 | * 限流key
23 | */
24 | public String key() default CacheConstants.RATE_LIMIT_KEY;
25 |
26 | /**
27 | * 限流时间,单位秒
28 | */
29 | public int time() default 60;
30 |
31 | /**
32 | * 限流次数
33 | */
34 | public int count() default 100;
35 |
36 | /**
37 | * 限流类型
38 | */
39 | public LimitType limitType() default LimitType.DEFAULT;
40 | }
41 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Inherited;
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 | import java.lang.annotation.Target;
9 |
10 | /**
11 | * 自定义注解防止表单重复提交
12 | *
13 | * @author ruoyi
14 | *
15 | */
16 | @Inherited
17 | @Target(ElementType.METHOD)
18 | @Retention(RetentionPolicy.RUNTIME)
19 | @Documented
20 | public @interface RepeatSubmit
21 | {
22 | /**
23 | * 间隔时间(ms),小于此时间视为重复提交
24 | */
25 | public int interval() default 5000;
26 |
27 | /**
28 | * 提示消息
29 | */
30 | public String message() default "不允许重复提交,请稍候再试";
31 | }
32 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.constant;
2 |
3 | /**
4 | * 缓存的key 常量
5 | *
6 | * @author ruoyi
7 | */
8 | public class CacheConstants
9 | {
10 | /**
11 | * 登录用户 redis key
12 | */
13 | public static final String LOGIN_TOKEN_KEY = "login_tokens:";
14 |
15 | /**
16 | * 验证码 redis key
17 | */
18 | public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
19 |
20 | /**
21 | * 参数管理 cache key
22 | */
23 | public static final String SYS_CONFIG_KEY = "sys_config:";
24 |
25 | /**
26 | * 字典管理 cache key
27 | */
28 | public static final String SYS_DICT_KEY = "sys_dict:";
29 |
30 | /**
31 | * 防重提交 redis key
32 | */
33 | public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
34 |
35 | /**
36 | * 限流 redis key
37 | */
38 | public static final String RATE_LIMIT_KEY = "rate_limit:";
39 |
40 | /**
41 | * 登录账户密码错误次数 redis key
42 | */
43 | public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
44 | }
45 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.constant;
2 |
3 | /**
4 | * 任务调度通用常量
5 | *
6 | * @author ruoyi
7 | */
8 | public class ScheduleConstants
9 | {
10 | public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
11 |
12 | /** 执行目标key */
13 | public static final String TASK_PROPERTIES = "TASK_PROPERTIES";
14 |
15 | /** 默认 */
16 | public static final String MISFIRE_DEFAULT = "0";
17 |
18 | /** 立即触发执行 */
19 | public static final String MISFIRE_IGNORE_MISFIRES = "1";
20 |
21 | /** 触发一次执行 */
22 | public static final String MISFIRE_FIRE_AND_PROCEED = "2";
23 |
24 | /** 不触发立即执行 */
25 | public static final String MISFIRE_DO_NOTHING = "3";
26 |
27 | public enum Status
28 | {
29 | /**
30 | * 正常
31 | */
32 | NORMAL("0"),
33 | /**
34 | * 暂停
35 | */
36 | PAUSE("1");
37 |
38 | private String value;
39 |
40 | private Status(String value)
41 | {
42 | this.value = value;
43 | }
44 |
45 | public String getValue()
46 | {
47 | return value;
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.core.domain.model;
2 |
3 | /**
4 | * 用户登录对象
5 | *
6 | * @author ruoyi
7 | */
8 | public class LoginBody
9 | {
10 | /**
11 | * 用户名
12 | */
13 | private String username;
14 |
15 | /**
16 | * 用户密码
17 | */
18 | private String password;
19 |
20 | /**
21 | * 验证码
22 | */
23 | private String code;
24 |
25 | /**
26 | * 唯一标识
27 | */
28 | private String uuid;
29 |
30 | public String getUsername()
31 | {
32 | return username;
33 | }
34 |
35 | public void setUsername(String username)
36 | {
37 | this.username = username;
38 | }
39 |
40 | public String getPassword()
41 | {
42 | return password;
43 | }
44 |
45 | public void setPassword(String password)
46 | {
47 | this.password = password;
48 | }
49 |
50 | public String getCode()
51 | {
52 | return code;
53 | }
54 |
55 | public void setCode(String code)
56 | {
57 | this.code = code;
58 | }
59 |
60 | public String getUuid()
61 | {
62 | return uuid;
63 | }
64 |
65 | public void setUuid(String uuid)
66 | {
67 | this.uuid = uuid;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/RegisterBody.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.core.domain.model;
2 |
3 | /**
4 | * 用户注册对象
5 | *
6 | * @author ruoyi
7 | */
8 | public class RegisterBody extends LoginBody
9 | {
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.enums;
2 |
3 | /**
4 | * 操作状态
5 | *
6 | * @author ruoyi
7 | *
8 | */
9 | public enum BusinessStatus
10 | {
11 | /**
12 | * 成功
13 | */
14 | SUCCESS,
15 |
16 | /**
17 | * 失败
18 | */
19 | FAIL,
20 | }
21 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.enums;
2 |
3 | /**
4 | * 业务操作类型
5 | *
6 | * @author ruoyi
7 | */
8 | public enum BusinessType
9 | {
10 | /**
11 | * 其它
12 | */
13 | OTHER,
14 |
15 | /**
16 | * 新增
17 | */
18 | INSERT,
19 |
20 | /**
21 | * 修改
22 | */
23 | UPDATE,
24 |
25 | /**
26 | * 删除
27 | */
28 | DELETE,
29 |
30 | /**
31 | * 授权
32 | */
33 | GRANT,
34 |
35 | /**
36 | * 导出
37 | */
38 | EXPORT,
39 |
40 | /**
41 | * 导入
42 | */
43 | IMPORT,
44 |
45 | /**
46 | * 强退
47 | */
48 | FORCE,
49 |
50 | /**
51 | * 生成代码
52 | */
53 | GENCODE,
54 |
55 | /**
56 | * 清空数据
57 | */
58 | CLEAN,
59 | }
60 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.enums;
2 |
3 | /**
4 | * 数据源
5 | *
6 | * @author ruoyi
7 | */
8 | public enum DataSourceType
9 | {
10 | /**
11 | * 主库
12 | */
13 | MASTER,
14 |
15 | /**
16 | * 从库
17 | */
18 | SLAVE
19 | }
20 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.enums;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 | import org.springframework.lang.Nullable;
6 |
7 | /**
8 | * 请求方式
9 | *
10 | * @author ruoyi
11 | */
12 | public enum HttpMethod
13 | {
14 | GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE;
15 |
16 | private static final Map mappings = new HashMap<>(16);
17 |
18 | static
19 | {
20 | for (HttpMethod httpMethod : values())
21 | {
22 | mappings.put(httpMethod.name(), httpMethod);
23 | }
24 | }
25 |
26 | @Nullable
27 | public static HttpMethod resolve(@Nullable String method)
28 | {
29 | return (method != null ? mappings.get(method) : null);
30 | }
31 |
32 | public boolean matches(String method)
33 | {
34 | return (this == resolve(method));
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/enums/LimitType.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.enums;
2 |
3 | /**
4 | * 限流类型
5 | *
6 | * @author ruoyi
7 | */
8 |
9 | public enum LimitType
10 | {
11 | /**
12 | * 默认策略全局限流
13 | */
14 | DEFAULT,
15 |
16 | /**
17 | * 根据请求者IP进行限流
18 | */
19 | IP
20 | }
21 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.enums;
2 |
3 | /**
4 | * 操作人类别
5 | *
6 | * @author ruoyi
7 | */
8 | public enum OperatorType
9 | {
10 | /**
11 | * 其它
12 | */
13 | OTHER,
14 |
15 | /**
16 | * 后台用户
17 | */
18 | MANAGE,
19 |
20 | /**
21 | * 手机端用户
22 | */
23 | MOBILE
24 | }
25 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.enums;
2 |
3 | /**
4 | * 用户状态
5 | *
6 | * @author ruoyi
7 | */
8 | public enum UserStatus
9 | {
10 | OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
11 |
12 | private final String code;
13 | private final String info;
14 |
15 | UserStatus(String code, String info)
16 | {
17 | this.code = code;
18 | this.info = info;
19 | }
20 |
21 | public String getCode()
22 | {
23 | return code;
24 | }
25 |
26 | public String getInfo()
27 | {
28 | return info;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception;
2 |
3 | /**
4 | * 演示模式异常
5 | *
6 | * @author ruoyi
7 | */
8 | public class DemoModeException extends RuntimeException
9 | {
10 | private static final long serialVersionUID = 1L;
11 |
12 | public DemoModeException()
13 | {
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception;
2 |
3 | /**
4 | * 全局异常
5 | *
6 | * @author ruoyi
7 | */
8 | public class GlobalException extends RuntimeException
9 | {
10 | private static final long serialVersionUID = 1L;
11 |
12 | /**
13 | * 错误提示
14 | */
15 | private String message;
16 |
17 | /**
18 | * 错误明细,内部调试错误
19 | *
20 | * 和 {@link CommonResult#getDetailMessage()} 一致的设计
21 | */
22 | private String detailMessage;
23 |
24 | /**
25 | * 空构造方法,避免反序列化问题
26 | */
27 | public GlobalException()
28 | {
29 | }
30 |
31 | public GlobalException(String message)
32 | {
33 | this.message = message;
34 | }
35 |
36 | public String getDetailMessage()
37 | {
38 | return detailMessage;
39 | }
40 |
41 | public GlobalException setDetailMessage(String detailMessage)
42 | {
43 | this.detailMessage = detailMessage;
44 | return this;
45 | }
46 |
47 | @Override
48 | public String getMessage()
49 | {
50 | return message;
51 | }
52 |
53 | public GlobalException setMessage(String message)
54 | {
55 | this.message = message;
56 | return this;
57 | }
58 | }
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception;
2 |
3 | /**
4 | * 工具类异常
5 | *
6 | * @author ruoyi
7 | */
8 | public class UtilException extends RuntimeException
9 | {
10 | private static final long serialVersionUID = 8247610319171014183L;
11 |
12 | public UtilException(Throwable e)
13 | {
14 | super(e.getMessage(), e);
15 | }
16 |
17 | public UtilException(String message)
18 | {
19 | super(message);
20 | }
21 |
22 | public UtilException(String message, Throwable throwable)
23 | {
24 | super(message, throwable);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.file;
2 |
3 | import com.ruoyi.common.exception.base.BaseException;
4 |
5 | /**
6 | * 文件信息异常类
7 | *
8 | * @author ruoyi
9 | */
10 | public class FileException extends BaseException
11 | {
12 | private static final long serialVersionUID = 1L;
13 |
14 | public FileException(String code, Object[] args)
15 | {
16 | super("file", code, args, null);
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.file;
2 |
3 | /**
4 | * 文件名称超长限制异常类
5 | *
6 | * @author ruoyi
7 | */
8 | public class FileNameLengthLimitExceededException extends FileException
9 | {
10 | private static final long serialVersionUID = 1L;
11 |
12 | public FileNameLengthLimitExceededException(int defaultFileNameLength)
13 | {
14 | super("upload.filename.exceed.length", new Object[] { defaultFileNameLength });
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.file;
2 |
3 | /**
4 | * 文件名大小限制异常类
5 | *
6 | * @author ruoyi
7 | */
8 | public class FileSizeLimitExceededException extends FileException
9 | {
10 | private static final long serialVersionUID = 1L;
11 |
12 | public FileSizeLimitExceededException(long defaultMaxSize)
13 | {
14 | super("upload.exceed.maxSize", new Object[] { defaultMaxSize });
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileUploadException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.file;
2 |
3 | import java.io.PrintStream;
4 | import java.io.PrintWriter;
5 |
6 | /**
7 | * 文件上传异常类
8 | *
9 | * @author ruoyi
10 | */
11 | public class FileUploadException extends Exception
12 | {
13 |
14 | private static final long serialVersionUID = 1L;
15 |
16 | private final Throwable cause;
17 |
18 | public FileUploadException()
19 | {
20 | this(null, null);
21 | }
22 |
23 | public FileUploadException(final String msg)
24 | {
25 | this(msg, null);
26 | }
27 |
28 | public FileUploadException(String msg, Throwable cause)
29 | {
30 | super(msg);
31 | this.cause = cause;
32 | }
33 |
34 | @Override
35 | public void printStackTrace(PrintStream stream)
36 | {
37 | super.printStackTrace(stream);
38 | if (cause != null)
39 | {
40 | stream.println("Caused by:");
41 | cause.printStackTrace(stream);
42 | }
43 | }
44 |
45 | @Override
46 | public void printStackTrace(PrintWriter writer)
47 | {
48 | super.printStackTrace(writer);
49 | if (cause != null)
50 | {
51 | writer.println("Caused by:");
52 | cause.printStackTrace(writer);
53 | }
54 | }
55 |
56 | @Override
57 | public Throwable getCause()
58 | {
59 | return cause;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.job;
2 |
3 | /**
4 | * 计划策略异常
5 | *
6 | * @author ruoyi
7 | */
8 | public class TaskException extends Exception
9 | {
10 | private static final long serialVersionUID = 1L;
11 |
12 | private Code code;
13 |
14 | public TaskException(String msg, Code code)
15 | {
16 | this(msg, code, null);
17 | }
18 |
19 | public TaskException(String msg, Code code, Exception nestedEx)
20 | {
21 | super(msg, nestedEx);
22 | this.code = code;
23 | }
24 |
25 | public Code getCode()
26 | {
27 | return code;
28 | }
29 |
30 | public enum Code
31 | {
32 | TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE
33 | }
34 | }
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/BlackListException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.user;
2 |
3 | /**
4 | * 黑名单IP异常类
5 | *
6 | * @author ruoyi
7 | */
8 | public class BlackListException extends UserException
9 | {
10 | private static final long serialVersionUID = 1L;
11 |
12 | public BlackListException()
13 | {
14 | super("login.blocked", null);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.user;
2 |
3 | /**
4 | * 验证码错误异常类
5 | *
6 | * @author ruoyi
7 | */
8 | public class CaptchaException extends UserException
9 | {
10 | private static final long serialVersionUID = 1L;
11 |
12 | public CaptchaException()
13 | {
14 | super("user.jcaptcha.error", null);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.user;
2 |
3 | /**
4 | * 验证码失效异常类
5 | *
6 | * @author ruoyi
7 | */
8 | public class CaptchaExpireException extends UserException
9 | {
10 | private static final long serialVersionUID = 1L;
11 |
12 | public CaptchaExpireException()
13 | {
14 | super("user.jcaptcha.expire", null);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.user;
2 |
3 | import com.ruoyi.common.exception.base.BaseException;
4 |
5 | /**
6 | * 用户信息异常类
7 | *
8 | * @author ruoyi
9 | */
10 | public class UserException extends BaseException
11 | {
12 | private static final long serialVersionUID = 1L;
13 |
14 | public UserException(String code, Object[] args)
15 | {
16 | super("user", code, args, null);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserNotExistsException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.user;
2 |
3 | /**
4 | * 用户不存在异常类
5 | *
6 | * @author ruoyi
7 | */
8 | public class UserNotExistsException extends UserException
9 | {
10 | private static final long serialVersionUID = 1L;
11 |
12 | public UserNotExistsException()
13 | {
14 | super("user.not.exists", null);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.user;
2 |
3 | /**
4 | * 用户密码不正确或不符合规范异常类
5 | *
6 | * @author ruoyi
7 | */
8 | public class UserPasswordNotMatchException extends UserException
9 | {
10 | private static final long serialVersionUID = 1L;
11 |
12 | public UserPasswordNotMatchException()
13 | {
14 | super("user.password.not.match", null);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.exception.user;
2 |
3 | /**
4 | * 用户错误最大次数异常类
5 | *
6 | * @author ruoyi
7 | */
8 | public class UserPasswordRetryLimitExceedException extends UserException
9 | {
10 | private static final long serialVersionUID = 1L;
11 |
12 | public UserPasswordRetryLimitExceedException(int retryLimitCount, int lockTime)
13 | {
14 | super("user.password.retry.limit.exceed", new Object[] { retryLimitCount, lockTime });
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/filter/PropertyPreExcludeFilter.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.filter;
2 |
3 | import com.alibaba.fastjson2.filter.SimplePropertyPreFilter;
4 |
5 | /**
6 | * 排除JSON敏感属性
7 | *
8 | * @author ruoyi
9 | */
10 | public class PropertyPreExcludeFilter extends SimplePropertyPreFilter
11 | {
12 | public PropertyPreExcludeFilter()
13 | {
14 | }
15 |
16 | public PropertyPreExcludeFilter addExcludes(String... filters)
17 | {
18 | for (int i = 0; i < filters.length; i++)
19 | {
20 | this.getExcludes().add(filters[i]);
21 | }
22 | return this;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.utils;
2 |
3 | import java.io.PrintWriter;
4 | import java.io.StringWriter;
5 | import org.apache.commons.lang3.exception.ExceptionUtils;
6 |
7 | /**
8 | * 错误信息处理类。
9 | *
10 | * @author ruoyi
11 | */
12 | public class ExceptionUtil
13 | {
14 | /**
15 | * 获取exception的详细错误信息。
16 | */
17 | public static String getExceptionMessage(Throwable e)
18 | {
19 | StringWriter sw = new StringWriter();
20 | e.printStackTrace(new PrintWriter(sw, true));
21 | return sw.toString();
22 | }
23 |
24 | public static String getRootErrorMessage(Exception e)
25 | {
26 | Throwable root = ExceptionUtils.getRootCause(e);
27 | root = (root == null ? e : root);
28 | if (root == null)
29 | {
30 | return "";
31 | }
32 | String msg = root.getMessage();
33 | if (msg == null)
34 | {
35 | return "null";
36 | }
37 | return StringUtils.defaultString(msg);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.utils;
2 |
3 | /**
4 | * 处理并记录日志文件
5 | *
6 | * @author ruoyi
7 | */
8 | public class LogUtils
9 | {
10 | public static String getBlock(Object msg)
11 | {
12 | if (msg == null)
13 | {
14 | msg = "";
15 | }
16 | return "[" + msg.toString() + "]";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.utils;
2 |
3 | import org.springframework.context.MessageSource;
4 | import org.springframework.context.i18n.LocaleContextHolder;
5 | import com.ruoyi.common.utils.spring.SpringUtils;
6 |
7 | /**
8 | * 获取i18n资源文件
9 | *
10 | * @author ruoyi
11 | */
12 | public class MessageUtils
13 | {
14 | /**
15 | * 根据消息键和参数 获取消息 委托给spring messageSource
16 | *
17 | * @param code 消息键
18 | * @param args 参数
19 | * @return 获取国际化翻译值
20 | */
21 | public static String message(String code, Object... args)
22 | {
23 | MessageSource messageSource = SpringUtils.getBean(MessageSource.class);
24 | return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.utils;
2 |
3 | import com.github.pagehelper.PageHelper;
4 | import com.ruoyi.common.core.page.PageDomain;
5 | import com.ruoyi.common.core.page.TableSupport;
6 | import com.ruoyi.common.utils.sql.SqlUtil;
7 |
8 | /**
9 | * 分页工具类
10 | *
11 | * @author ruoyi
12 | */
13 | public class PageUtils extends PageHelper
14 | {
15 | /**
16 | * 设置请求分页数据
17 | */
18 | public static void startPage()
19 | {
20 | PageDomain pageDomain = TableSupport.buildPageRequest();
21 | Integer pageNum = pageDomain.getPageNum();
22 | Integer pageSize = pageDomain.getPageSize();
23 | String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
24 | Boolean reasonable = pageDomain.getReasonable();
25 | PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
26 | }
27 |
28 | /**
29 | * 清理分页的线程变量
30 | */
31 | public static void clearPage()
32 | {
33 | PageHelper.clearPage();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanValidators.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.utils.bean;
2 |
3 | import java.util.Set;
4 | import javax.validation.ConstraintViolation;
5 | import javax.validation.ConstraintViolationException;
6 | import javax.validation.Validator;
7 |
8 | /**
9 | * bean对象属性验证
10 | *
11 | * @author ruoyi
12 | */
13 | public class BeanValidators
14 | {
15 | public static void validateWithException(Validator validator, Object object, Class>... groups)
16 | throws ConstraintViolationException
17 | {
18 | Set> constraintViolations = validator.validate(object, groups);
19 | if (!constraintViolations.isEmpty())
20 | {
21 | throw new ConstraintViolationException(constraintViolations);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.utils.poi;
2 |
3 | import org.apache.poi.ss.usermodel.Cell;
4 | import org.apache.poi.ss.usermodel.Workbook;
5 |
6 | /**
7 | * Excel数据格式处理适配器
8 | *
9 | * @author ruoyi
10 | */
11 | public interface ExcelHandlerAdapter
12 | {
13 | /**
14 | * 格式化
15 | *
16 | * @param value 单元格数据值
17 | * @param args excel注解args参数组
18 | * @param cell 单元格对象
19 | * @param wb 工作簿对象
20 | *
21 | * @return 处理后的值
22 | */
23 | Object format(Object value, String[] args, Cell cell, Workbook wb);
24 | }
25 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.utils.uuid;
2 |
3 | /**
4 | * ID生成器工具类
5 | *
6 | * @author ruoyi
7 | */
8 | public class IdUtils
9 | {
10 | /**
11 | * 获取随机UUID
12 | *
13 | * @return 随机UUID
14 | */
15 | public static String randomUUID()
16 | {
17 | return UUID.randomUUID().toString();
18 | }
19 |
20 | /**
21 | * 简化的UUID,去掉了横线
22 | *
23 | * @return 简化的UUID,去掉了横线
24 | */
25 | public static String simpleUUID()
26 | {
27 | return UUID.randomUUID().toString(true);
28 | }
29 |
30 | /**
31 | * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID
32 | *
33 | * @return 随机UUID
34 | */
35 | public static String fastUUID()
36 | {
37 | return UUID.fastUUID().toString();
38 | }
39 |
40 | /**
41 | * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID
42 | *
43 | * @return 简化的UUID,去掉了横线
44 | */
45 | public static String fastSimpleUUID()
46 | {
47 | return UUID.fastUUID().toString(true);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/xss/Xss.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.xss;
2 |
3 | import javax.validation.Constraint;
4 | import javax.validation.Payload;
5 | import java.lang.annotation.ElementType;
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 | import java.lang.annotation.Target;
9 |
10 | /**
11 | * 自定义xss校验注解
12 | *
13 | * @author ruoyi
14 | */
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Target(value = { ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER })
17 | @Constraint(validatedBy = { XssValidator.class })
18 | public @interface Xss
19 | {
20 | String message()
21 |
22 | default "不允许任何脚本运行";
23 |
24 | Class>[] groups() default {};
25 |
26 | Class extends Payload>[] payload() default {};
27 | }
28 |
--------------------------------------------------------------------------------
/ruoyi-common/src/main/java/com/ruoyi/common/xss/XssValidator.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.common.xss;
2 |
3 | import com.ruoyi.common.utils.StringUtils;
4 | import javax.validation.ConstraintValidator;
5 | import javax.validation.ConstraintValidatorContext;
6 | import java.util.regex.Matcher;
7 | import java.util.regex.Pattern;
8 |
9 | /**
10 | * 自定义xss校验注解实现
11 | *
12 | * @author ruoyi
13 | */
14 | public class XssValidator implements ConstraintValidator
15 | {
16 | private static final String HTML_PATTERN = "<(\\S*?)[^>]*>.*?|<.*? />";
17 |
18 | @Override
19 | public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext)
20 | {
21 | if (StringUtils.isBlank(value))
22 | {
23 | return true;
24 | }
25 | return !containsHtml(value);
26 | }
27 |
28 | public static boolean containsHtml(String value)
29 | {
30 | StringBuilder sHtml = new StringBuilder();
31 | Pattern pattern = Pattern.compile(HTML_PATTERN);
32 | Matcher matcher = pattern.matcher(value);
33 | while (matcher.find())
34 | {
35 | sHtml.append(matcher.group());
36 | }
37 | return pattern.matcher(sHtml).matches();
38 | }
39 | }
--------------------------------------------------------------------------------
/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.framework.config;
2 |
3 | import java.util.TimeZone;
4 | import org.mybatis.spring.annotation.MapperScan;
5 | import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.Configuration;
8 | import org.springframework.context.annotation.EnableAspectJAutoProxy;
9 |
10 | /**
11 | * 程序注解配置
12 | *
13 | * @author ruoyi
14 | */
15 | @Configuration
16 | // 表示通过aop框架暴露该代理对象,AopContext能够访问
17 | @EnableAspectJAutoProxy(exposeProxy = true)
18 | // 指定要扫描的Mapper类的包的路径
19 | @MapperScan("com.ruoyi.**.mapper")
20 | public class ApplicationConfig
21 | {
22 | /**
23 | * 时区配置
24 | */
25 | @Bean
26 | public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization()
27 | {
28 | return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault());
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.framework.config;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import org.springframework.stereotype.Component;
5 | import com.ruoyi.common.utils.ServletUtils;
6 |
7 | /**
8 | * 服务相关配置
9 | *
10 | * @author ruoyi
11 | */
12 | @Component
13 | public class ServerConfig
14 | {
15 | /**
16 | * 获取完整的请求路径,包括:域名,端口,上下文访问路径
17 | *
18 | * @return 服务地址
19 | */
20 | public String getUrl()
21 | {
22 | HttpServletRequest request = ServletUtils.getRequest();
23 | return getDomain(request);
24 | }
25 |
26 | public static String getDomain(HttpServletRequest request)
27 | {
28 | StringBuffer url = request.getRequestURL();
29 | String contextPath = request.getServletContext().getContextPath();
30 | return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java:
--------------------------------------------------------------------------------
1 | package com.ruoyi.framework.datasource;
2 |
3 | import java.util.Map;
4 | import javax.sql.DataSource;
5 | import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
6 |
7 | /**
8 | * 动态数据源
9 | *
10 | * @author ruoyi
11 | */
12 | public class DynamicDataSource extends AbstractRoutingDataSource
13 | {
14 | public DynamicDataSource(DataSource defaultTargetDataSource, Map