├── ruoyi-ui ├── public │ ├── robots.txt │ └── favicon.ico ├── bin │ ├── build.bat │ ├── package.bat │ └── run-web.bat ├── src │ ├── components │ │ ├── ParentView │ │ │ └── index.vue │ │ ├── IconSelect │ │ │ └── requireIcons.js │ │ ├── RuoYi │ │ │ ├── Doc │ │ │ │ └── index.vue │ │ │ └── Git │ │ │ │ └── index.vue │ │ ├── iFrame │ │ │ └── index.vue │ │ ├── Screenfull │ │ │ └── index.vue │ │ ├── Hamburger │ │ │ └── index.vue │ │ ├── DictData │ │ │ └── index.js │ │ ├── DictTag │ │ │ └── index.vue │ │ └── SvgIcon │ │ │ └── index.vue │ ├── assets │ │ ├── logo │ │ │ └── logo.png │ │ ├── 401_images │ │ │ └── 401.gif │ │ ├── 404_images │ │ │ ├── 404.png │ │ │ └── 404_cloud.png │ │ ├── images │ │ │ ├── profile.jpg │ │ │ └── login-background.jpg │ │ ├── icons │ │ │ ├── svg │ │ │ │ ├── chart.svg │ │ │ │ ├── size.svg │ │ │ │ ├── link.svg │ │ │ │ ├── guide.svg │ │ │ │ ├── money.svg │ │ │ │ ├── email.svg │ │ │ │ ├── drag.svg │ │ │ │ ├── documentation.svg │ │ │ │ ├── fullscreen.svg │ │ │ │ ├── user.svg │ │ │ │ ├── lock.svg │ │ │ │ ├── excel.svg │ │ │ │ ├── example.svg │ │ │ │ ├── star.svg │ │ │ │ ├── slider.svg │ │ │ │ ├── table.svg │ │ │ │ ├── search.svg │ │ │ │ ├── education.svg │ │ │ │ ├── tab.svg │ │ │ │ ├── message.svg │ │ │ │ ├── switch.svg │ │ │ │ ├── theme.svg │ │ │ │ ├── code.svg │ │ │ │ ├── druid.svg │ │ │ │ ├── peoples.svg │ │ │ │ ├── input.svg │ │ │ │ ├── server.svg │ │ │ │ ├── textarea.svg │ │ │ │ ├── time.svg │ │ │ │ ├── edit.svg │ │ │ │ ├── nested.svg │ │ │ │ ├── row.svg │ │ │ │ ├── monitor.svg │ │ │ │ ├── tree-table.svg │ │ │ │ ├── eye.svg │ │ │ │ ├── build.svg │ │ │ │ ├── clipboard.svg │ │ │ │ ├── list.svg │ │ │ │ ├── download.svg │ │ │ │ ├── icon.svg │ │ │ │ ├── international.svg │ │ │ │ ├── question.svg │ │ │ │ ├── wechat.svg │ │ │ │ ├── skill.svg │ │ │ │ ├── people.svg │ │ │ │ ├── post.svg │ │ │ │ ├── checkbox.svg │ │ │ │ ├── language.svg │ │ │ │ ├── eye-open.svg │ │ │ │ ├── validCode.svg │ │ │ │ ├── radio.svg │ │ │ │ ├── select.svg │ │ │ │ ├── upload.svg │ │ │ │ ├── 404.svg │ │ │ │ ├── zip.svg │ │ │ │ └── phone.svg │ │ │ ├── index.js │ │ │ └── svgo.yml │ │ └── styles │ │ │ ├── element-variables.scss │ │ │ └── transition.scss │ ├── utils │ │ ├── errorCode.js │ │ ├── dict │ │ │ ├── DictData.js │ │ │ ├── DictConverter.js │ │ │ ├── index.js │ │ │ ├── DictMeta.js │ │ │ └── DictOptions.js │ │ ├── auth.js │ │ ├── generator │ │ │ ├── css.js │ │ │ └── drawingDefault.js │ │ ├── jsencrypt.js │ │ └── permission.js │ ├── api │ │ ├── menu.js │ │ ├── monitor │ │ │ ├── server.js │ │ │ ├── online.js │ │ │ ├── jobLog.js │ │ │ ├── operlog.js │ │ │ ├── logininfor.js │ │ │ ├── cache.js │ │ │ └── job.js │ │ ├── system │ │ │ ├── post.js │ │ │ ├── notice.js │ │ │ ├── dept.js │ │ │ ├── dict │ │ │ │ ├── data.js │ │ │ │ └── type.js │ │ │ ├── menu.js │ │ │ └── config.js │ │ └── login.js │ ├── layout │ │ ├── components │ │ │ ├── index.js │ │ │ ├── IframeToggle │ │ │ │ └── index.vue │ │ │ ├── Sidebar │ │ │ │ ├── FixiOSBug.js │ │ │ │ ├── Item.vue │ │ │ │ └── Link.vue │ │ │ ├── InnerLink │ │ │ │ └── index.vue │ │ │ └── AppMain.vue │ │ └── mixin │ │ │ └── ResizeHandler.js │ ├── views │ │ ├── redirect.vue │ │ ├── components │ │ │ └── icons │ │ │ │ └── svg-icons.js │ │ ├── monitor │ │ │ └── druid │ │ │ │ └── index.vue │ │ └── tool │ │ │ └── swagger │ │ │ └── index.vue │ ├── plugins │ │ └── index.js │ ├── store │ │ ├── index.js │ │ ├── getters.js │ │ └── modules │ │ │ ├── dict.js │ │ │ └── settings.js │ ├── App.vue │ ├── directive │ │ ├── permission │ │ │ ├── hasRole.js │ │ │ └── hasPermi.js │ │ ├── index.js │ │ └── dialog │ │ │ ├── dragWidth.js │ │ │ └── dragHeight.js │ └── settings.js ├── .env.production ├── .env.staging ├── .eslintignore ├── .env.development ├── .gitignore ├── .editorconfig ├── README.md ├── babel.config.js └── build │ └── index.js ├── ry.bat ├── bin ├── run.bat ├── clean.bat └── package.bat ├── .github └── FUNDING.yml ├── doc └── 若依环境使用手册.docx ├── ruoyi-admin └── src │ └── main │ ├── resources │ ├── META-INF │ │ └── spring-devtools.properties │ ├── mybatis │ │ └── mybatis-config.xml │ └── i18n │ │ └── messages.properties │ └── java │ └── com │ └── ruoyi │ ├── RuoYiServletInitializer.java │ ├── web │ └── controller │ │ ├── tool │ │ └── SwaggerController.java │ │ ├── system │ │ ├── SysIndexController.java │ │ └── SysRegisterController.java │ │ └── monitor │ │ └── ServerController.java │ └── RuoYiApplication.java ├── ruoyi-generator ├── src │ └── main │ │ ├── resources │ │ ├── vm │ │ │ ├── vue │ │ │ │ └── v3 │ │ │ │ │ └── readme.txt │ │ │ └── js │ │ │ │ └── api.js.vm │ │ └── generator.yml │ │ └── java │ │ └── com │ │ └── ruoyi │ │ └── generator │ │ ├── util │ │ └── VelocityInitializer.java │ │ ├── service │ │ └── IGenTableColumnService.java │ │ └── mapper │ │ └── GenTableColumnMapper.java └── pom.xml ├── ruoyi-common └── src │ └── main │ └── java │ └── com │ └── ruoyi │ └── common │ ├── core │ └── domain │ │ └── model │ │ ├── RegisterBody.java │ │ └── LoginBody.java │ ├── enums │ ├── DataSourceType.java │ ├── BusinessStatus.java │ ├── LimitType.java │ ├── OperatorType.java │ ├── UserStatus.java │ ├── BusinessType.java │ └── HttpMethod.java │ ├── exception │ ├── DemoModeException.java │ ├── user │ │ ├── CaptchaException.java │ │ ├── CaptchaExpireException.java │ │ ├── UserPasswordNotMatchException.java │ │ ├── UserException.java │ │ └── UserPasswordRetryLimitExceedException.java │ ├── file │ │ ├── FileException.java │ │ ├── FileSizeLimitExceededException.java │ │ └── FileNameLengthLimitExceededException.java │ ├── UtilException.java │ ├── job │ │ └── TaskException.java │ └── GlobalException.java │ ├── utils │ ├── LogUtils.java │ ├── poi │ │ └── ExcelHandlerAdapter.java │ ├── MessageUtils.java │ ├── bean │ │ └── BeanValidators.java │ ├── PageUtils.java │ ├── ExceptionUtil.java │ └── uuid │ │ └── IdUtils.java │ ├── annotation │ ├── Excels.java │ ├── Anonymous.java │ ├── RepeatSubmit.java │ ├── DataSource.java │ ├── DataScope.java │ ├── RateLimiter.java │ └── Log.java │ ├── filter │ └── PropertyPreExcludeFilter.java │ ├── xss │ ├── Xss.java │ └── XssValidator.java │ └── constant │ ├── CacheConstants.java │ └── ScheduleConstants.java ├── ruoyi-quartz ├── src │ └── main │ │ └── java │ │ └── com │ │ └── ruoyi │ │ └── quartz │ │ ├── util │ │ ├── QuartzJobExecution.java │ │ └── QuartzDisallowConcurrentExecution.java │ │ ├── task │ │ └── RyTask.java │ │ ├── service │ │ └── ISysJobLogService.java │ │ └── mapper │ │ ├── SysJobMapper.java │ │ └── SysJobLogMapper.java └── pom.xml ├── ruoyi-framework └── src │ └── main │ └── java │ └── com │ └── ruoyi │ └── framework │ ├── security │ ├── context │ │ ├── AuthenticationContextHolder.java │ │ └── PermissionContextHolder.java │ └── handle │ │ └── AuthenticationEntryPointImpl.java │ ├── datasource │ ├── DynamicDataSource.java │ └── DynamicDataSourceContextHolder.java │ ├── manager │ ├── ShutdownManager.java │ └── AsyncManager.java │ ├── config │ ├── ServerConfig.java │ ├── ApplicationConfig.java │ └── FastJson2JsonRedisSerializer.java │ └── web │ └── domain │ └── server │ └── Mem.java ├── .gitignore ├── ruoyi-system ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── ruoyi │ │ └── system │ │ ├── service │ │ ├── ISysLogininforService.java │ │ ├── ISysOperLogService.java │ │ ├── ISysUserOnlineService.java │ │ ├── ISysNoticeService.java │ │ └── ISysDictDataService.java │ │ ├── mapper │ │ ├── SysLogininforMapper.java │ │ ├── SysRoleMenuMapper.java │ │ ├── SysUserPostMapper.java │ │ ├── SysRoleDeptMapper.java │ │ ├── SysOperLogMapper.java │ │ ├── SysNoticeMapper.java │ │ ├── SysUserRoleMapper.java │ │ └── SysConfigMapper.java │ │ └── domain │ │ ├── SysRoleDept.java │ │ ├── SysRoleMenu.java │ │ ├── SysUserPost.java │ │ └── SysUserRole.java │ └── resources │ └── mapper │ └── system │ ├── SysUserPostMapper.xml │ ├── SysRoleMenuMapper.xml │ └── SysRoleDeptMapper.xml └── LICENSE /ruoyi-ui/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / -------------------------------------------------------------------------------- /ry.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ry.bat -------------------------------------------------------------------------------- /bin/run.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/bin/run.bat -------------------------------------------------------------------------------- /bin/clean.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/bin/clean.bat -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: http://doc.ruoyi.vip/ruoyi-vue/other/donate.html 2 | -------------------------------------------------------------------------------- /bin/package.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/bin/package.bat -------------------------------------------------------------------------------- /doc/若依环境使用手册.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/doc/若依环境使用手册.docx -------------------------------------------------------------------------------- /ruoyi-ui/bin/build.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ruoyi-ui/bin/build.bat -------------------------------------------------------------------------------- /ruoyi-ui/src/components/ParentView/index.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /ruoyi-ui/bin/package.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ruoyi-ui/bin/package.bat -------------------------------------------------------------------------------- /ruoyi-ui/bin/run-web.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ruoyi-ui/bin/run-web.bat -------------------------------------------------------------------------------- /ruoyi-ui/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ruoyi-ui/public/favicon.ico -------------------------------------------------------------------------------- /ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties: -------------------------------------------------------------------------------- 1 | restart.include.json=/com.alibaba.fastjson.*.jar -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ruoyi-ui/src/assets/logo/logo.png -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/401_images/401.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ruoyi-ui/src/assets/401_images/401.gif -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/404_images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ruoyi-ui/src/assets/404_images/404.png -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/images/profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ruoyi-ui/src/assets/images/profile.jpg -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/404_images/404_cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ruoyi-ui/src/assets/404_images/404_cloud.png -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/images/login-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ruoyi-ui/src/assets/images/login-background.jpg -------------------------------------------------------------------------------- /ruoyi-generator/src/main/resources/vm/vue/v3/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jay-l23/Medical/HEAD/ruoyi-generator/src/main/resources/vm/vue/v3/readme.txt -------------------------------------------------------------------------------- /ruoyi-ui/.env.production: -------------------------------------------------------------------------------- 1 | # 页面标题 2 | VUE_APP_TITLE = 若依管理系统 3 | 4 | # 生产环境配置 5 | ENV = 'production' 6 | 7 | # 若依管理系统/生产环境 8 | VUE_APP_BASE_API = '/prod-api' 9 | -------------------------------------------------------------------------------- /ruoyi-ui/src/utils/errorCode.js: -------------------------------------------------------------------------------- 1 | export default { 2 | '401': '认证失败,无法访问系统资源', 3 | '403': '当前操作没有权限', 4 | '404': '访问资源不存在', 5 | 'default': '系统未知错误,请反馈给管理员' 6 | } 7 | -------------------------------------------------------------------------------- /ruoyi-ui/.env.staging: -------------------------------------------------------------------------------- 1 | # 页面标题 2 | VUE_APP_TITLE = 若依管理系统 3 | 4 | NODE_ENV = production 5 | 6 | # 测试环境配置 7 | ENV = 'staging' 8 | 9 | # 若依管理系统/测试环境 10 | VUE_APP_BASE_API = '/stage-api' 11 | -------------------------------------------------------------------------------- /ruoyi-ui/src/api/menu.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 获取路由 4 | export const getRouters = () => { 5 | return request({ 6 | url: '/getRouters', 7 | method: 'get' 8 | }) 9 | } -------------------------------------------------------------------------------- /ruoyi-ui/src/api/monitor/server.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 获取服务信息 4 | export function getServer() { 5 | return request({ 6 | url: '/monitor/server', 7 | method: 'get' 8 | }) 9 | } -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/chart.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/.eslintignore: -------------------------------------------------------------------------------- 1 | # 忽略build目录下类型为js的文件的语法检查 2 | build/*.js 3 | # 忽略src/assets目录下文件的语法检查 4 | src/assets 5 | # 忽略public目录下文件的语法检查 6 | public 7 | # 忽略当前目录下为js的文件的语法检查 8 | *.js 9 | # 忽略当前目录下为vue的文件的语法检查 10 | *.vue -------------------------------------------------------------------------------- /ruoyi-ui/.env.development: -------------------------------------------------------------------------------- 1 | # 页面标题 2 | VUE_APP_TITLE = 若依管理系统 3 | 4 | # 开发环境配置 5 | ENV = 'development' 6 | 7 | # 若依管理系统/开发环境 8 | VUE_APP_BASE_API = '/dev-api' 9 | 10 | # 路由懒加载 11 | VUE_CLI_BABEL_TRANSPILE_MODULES = true 12 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/size.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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-generator/src/main/resources/generator.yml: -------------------------------------------------------------------------------- 1 | # 代码生成 2 | gen: 3 | # 作者 4 | author: ruoyi 5 | # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool 6 | packageName: com.ruoyi.system 7 | # 自动去除表前缀,默认是false 8 | autoRemovePre: false 9 | # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) 10 | tablePrefix: sys_ -------------------------------------------------------------------------------- /ruoyi-ui/src/layout/components/index.js: -------------------------------------------------------------------------------- 1 | export { default as AppMain } from './AppMain' 2 | export { default as Navbar } from './Navbar' 3 | export { default as Settings } from './Settings' 4 | export { default as Sidebar } from './Sidebar/index.vue' 5 | export { default as TagsView } from './TagsView/index.vue' 6 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/link.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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-ui/src/views/redirect.vue: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /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/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-ui/src/components/IconSelect/requireIcons.js: -------------------------------------------------------------------------------- 1 | 2 | const req = require.context('../../assets/icons/svg', false, /\.svg$/) 3 | const requireAll = requireContext => requireContext.keys() 4 | 5 | const re = /\.\/(.*)\.svg/ 6 | 7 | const icons = requireAll(req).map(i => { 8 | return i.match(re)[1] 9 | }) 10 | 11 | export default icons 12 | -------------------------------------------------------------------------------- /ruoyi-ui/src/utils/dict/DictData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @classdesc 字典数据 3 | * @property {String} label 标签 4 | * @property {*} value 标签 5 | * @property {Object} raw 原始数据 6 | */ 7 | export default class DictData { 8 | constructor(label, value, raw) { 9 | this.label = label 10 | this.value = value 11 | this.raw = raw 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ruoyi-ui/src/views/components/icons/svg-icons.js: -------------------------------------------------------------------------------- 1 | const req = require.context('../../../assets/icons/svg', false, /\.svg$/) 2 | const requireAll = requireContext => requireContext.keys() 3 | 4 | const re = /\.\/(.*)\.svg/ 5 | 6 | const svgIcons = requireAll(req).map(i => { 7 | return i.match(re)[1] 8 | }) 9 | 10 | export default svgIcons 11 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/guide.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import SvgIcon from '@/components/SvgIcon'// svg component 3 | 4 | // register globally 5 | Vue.component('svg-icon', SvgIcon) 6 | 7 | const req = require.context('./svg', false, /\.svg$/) 8 | const requireAll = requireContext => requireContext.keys().map(requireContext) 9 | requireAll(req) 10 | -------------------------------------------------------------------------------- /ruoyi-ui/src/utils/auth.js: -------------------------------------------------------------------------------- 1 | import Cookies from 'js-cookie' 2 | 3 | const TokenKey = 'Admin-Token' 4 | 5 | export function getToken() { 6 | return Cookies.get(TokenKey) 7 | } 8 | 9 | export function setToken(token) { 10 | return Cookies.set(TokenKey, token) 11 | } 12 | 13 | export function removeToken() { 14 | return Cookies.remove(TokenKey) 15 | } 16 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/money.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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-ui/src/assets/icons/svg/email.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | **/*.log 8 | 9 | tests/**/coverage/ 10 | tests/e2e/reports 11 | selenium-debug.log 12 | 13 | # Editor directories and files 14 | .idea 15 | .vscode 16 | *.suo 17 | *.ntvs* 18 | *.njsproj 19 | *.sln 20 | *.local 21 | 22 | package-lock.json 23 | yarn.lock 24 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svgo.yml: -------------------------------------------------------------------------------- 1 | # replace default config 2 | 3 | # multipass: true 4 | # full: true 5 | 6 | plugins: 7 | 8 | # - name 9 | # 10 | # or: 11 | # - name: false 12 | # - name: true 13 | # 14 | # or: 15 | # - name: 16 | # param1: 1 17 | # param2: 2 18 | 19 | - removeAttrs: 20 | attrs: 21 | - 'fill' 22 | - 'fill-rule' 23 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/drag.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/views/monitor/druid/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 16 | -------------------------------------------------------------------------------- /ruoyi-ui/src/views/tool/swagger/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 16 | -------------------------------------------------------------------------------- /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/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-ui/src/api/monitor/online.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 查询在线用户列表 4 | export function list(query) { 5 | return request({ 6 | url: '/monitor/online/list', 7 | method: 'get', 8 | params: query 9 | }) 10 | } 11 | 12 | // 强退用户 13 | export function forceLogout(tokenId) { 14 | return request({ 15 | url: '/monitor/online/' + tokenId, 16 | method: 'delete' 17 | }) 18 | } 19 | -------------------------------------------------------------------------------- /ruoyi-ui/src/components/RuoYi/Doc/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /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-ui/src/components/RuoYi/Git/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /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-ui/src/assets/icons/svg/documentation.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/fullscreen.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils.poi; 2 | 3 | /** 4 | * Excel数据格式处理适配器 5 | * 6 | * @author ruoyi 7 | */ 8 | public interface ExcelHandlerAdapter 9 | { 10 | /** 11 | * 格式化 12 | * 13 | * @param value 单元格数据值 14 | * @param args excel注解args参数组 15 | * 16 | * @return 处理后的值 17 | */ 18 | Object format(Object value, String[] args); 19 | } 20 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/user.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/lock.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/.editorconfig: -------------------------------------------------------------------------------- 1 | # 告诉EditorConfig插件,这是根文件,不用继续往上查找 2 | root = true 3 | 4 | # 匹配全部文件 5 | [*] 6 | # 设置字符集 7 | charset = utf-8 8 | # 缩进风格,可选space、tab 9 | indent_style = space 10 | # 缩进的空格数 11 | indent_size = 2 12 | # 结尾换行符,可选lf、cr、crlf 13 | end_of_line = lf 14 | # 在文件结尾插入新行 15 | insert_final_newline = true 16 | # 删除一行中的前后空格 17 | trim_trailing_whitespace = true 18 | 19 | # 匹配md结尾的文件 20 | [*.md] 21 | insert_final_newline = false 22 | trim_trailing_whitespace = false 23 | -------------------------------------------------------------------------------- /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-ui/src/assets/icons/svg/excel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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/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-ui/README.md: -------------------------------------------------------------------------------- 1 | ## 开发 2 | 3 | ```bash 4 | # 克隆项目 5 | git clone https://gitee.com/y_project/RuoYi-Vue 6 | 7 | # 进入项目目录 8 | cd ruoyi-ui 9 | 10 | # 安装依赖 11 | npm install 12 | 13 | # 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 14 | npm install --registry=https://registry.npmmirror.com 15 | 16 | # 启动服务 17 | npm run dev 18 | ``` 19 | 20 | 浏览器访问 http://localhost:80 21 | 22 | ## 发布 23 | 24 | ```bash 25 | # 构建测试环境 26 | npm run build:stage 27 | 28 | # 构建生产环境 29 | npm run build:prod 30 | ``` -------------------------------------------------------------------------------- /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/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-ui/src/assets/icons/svg/example.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/plugins/index.js: -------------------------------------------------------------------------------- 1 | import tab from './tab' 2 | import auth from './auth' 3 | import cache from './cache' 4 | import modal from './modal' 5 | import download from './download' 6 | 7 | export default { 8 | install(Vue) { 9 | // 页签操作 10 | Vue.prototype.$tab = tab 11 | // 认证对象 12 | Vue.prototype.$auth = auth 13 | // 缓存对象 14 | Vue.prototype.$cache = cache 15 | // 模态框对象 16 | Vue.prototype.$modal = modal 17 | // 下载文件 18 | Vue.prototype.$download = download 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ruoyi-ui/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app 4 | '@vue/cli-plugin-babel/preset' 5 | ], 6 | 'env': { 7 | 'development': { 8 | // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require(). 9 | // This plugin can significantly increase the speed of hot updates, when you have a large number of pages. 10 | 'plugins': ['dynamic-import-node'] 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.quartz.util; 2 | 3 | import org.quartz.JobExecutionContext; 4 | import com.ruoyi.quartz.domain.SysJob; 5 | 6 | /** 7 | * 定时任务处理(允许并发执行) 8 | * 9 | * @author ruoyi 10 | * 11 | */ 12 | public class QuartzJobExecution extends AbstractQuartzJob 13 | { 14 | @Override 15 | protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception 16 | { 17 | JobInvokeUtil.invokeMethod(sysJob); 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/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/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-ui/src/assets/icons/svg/star.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/api/monitor/jobLog.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 查询调度日志列表 4 | export function listJobLog(query) { 5 | return request({ 6 | url: '/monitor/jobLog/list', 7 | method: 'get', 8 | params: query 9 | }) 10 | } 11 | 12 | // 删除调度日志 13 | export function delJobLog(jobLogId) { 14 | return request({ 15 | url: '/monitor/jobLog/' + jobLogId, 16 | method: 'delete' 17 | }) 18 | } 19 | 20 | // 清空调度日志 21 | export function cleanJobLog() { 22 | return request({ 23 | url: '/monitor/jobLog/clean', 24 | method: 'delete' 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /ruoyi-ui/src/api/monitor/operlog.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 查询操作日志列表 4 | export function list(query) { 5 | return request({ 6 | url: '/monitor/operlog/list', 7 | method: 'get', 8 | params: query 9 | }) 10 | } 11 | 12 | // 删除操作日志 13 | export function delOperlog(operId) { 14 | return request({ 15 | url: '/monitor/operlog/' + operId, 16 | method: 'delete' 17 | }) 18 | } 19 | 20 | // 清空操作日志 21 | export function cleanOperlog() { 22 | return request({ 23 | url: '/monitor/operlog/clean', 24 | method: 'delete' 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/slider.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/utils/generator/css.js: -------------------------------------------------------------------------------- 1 | const styles = { 2 | 'el-rate': '.el-rate{display: inline-block; vertical-align: text-top;}', 3 | 'el-upload': '.el-upload__tip{line-height: 1.2;}' 4 | } 5 | 6 | function addCss(cssList, el) { 7 | const css = styles[el.tag] 8 | css && cssList.indexOf(css) === -1 && cssList.push(css) 9 | if (el.children) { 10 | el.children.forEach(el2 => addCss(cssList, el2)) 11 | } 12 | } 13 | 14 | export function makeUpCss(conf) { 15 | const cssList = [] 16 | conf.fields.forEach(el => addCss(cssList, el)) 17 | return cssList.join('\n') 18 | } 19 | -------------------------------------------------------------------------------- /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-ui/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import app from './modules/app' 4 | import dict from './modules/dict' 5 | import user from './modules/user' 6 | import tagsView from './modules/tagsView' 7 | import permission from './modules/permission' 8 | import settings from './modules/settings' 9 | import getters from './getters' 10 | 11 | Vue.use(Vuex) 12 | 13 | const store = new Vuex.Store({ 14 | modules: { 15 | app, 16 | dict, 17 | user, 18 | tagsView, 19 | permission, 20 | settings 21 | }, 22 | getters 23 | }) 24 | 25 | export default store 26 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/table.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/search.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.quartz.util; 2 | 3 | import org.quartz.DisallowConcurrentExecution; 4 | import org.quartz.JobExecutionContext; 5 | import com.ruoyi.quartz.domain.SysJob; 6 | 7 | /** 8 | * 定时任务处理(禁止并发执行) 9 | * 10 | * @author ruoyi 11 | * 12 | */ 13 | @DisallowConcurrentExecution 14 | public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob 15 | { 16 | @Override 17 | protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception 18 | { 19 | JobInvokeUtil.invokeMethod(sysJob); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/education.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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/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-ui/src/assets/icons/svg/tab.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/layout/components/IframeToggle/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 25 | -------------------------------------------------------------------------------- /ruoyi-ui/src/utils/dict/DictConverter.js: -------------------------------------------------------------------------------- 1 | import DictOptions from './DictOptions' 2 | import DictData from './DictData' 3 | 4 | export default function(dict, dictMeta) { 5 | const label = determineDictField(dict, dictMeta.labelField, ...DictOptions.DEFAULT_LABEL_FIELDS) 6 | const value = determineDictField(dict, dictMeta.valueField, ...DictOptions.DEFAULT_VALUE_FIELDS) 7 | return new DictData(dict[label], dict[value], dict) 8 | } 9 | 10 | /** 11 | * 确定字典字段 12 | * @param {DictData} dict 13 | * @param {...String} fields 14 | */ 15 | function determineDictField(dict, ...fields) { 16 | return fields.find(f => Object.prototype.hasOwnProperty.call(dict, f)) 17 | } 18 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/message.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/switch.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/theme.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/layout/components/Sidebar/FixiOSBug.js: -------------------------------------------------------------------------------- 1 | export default { 2 | computed: { 3 | device() { 4 | return this.$store.state.app.device 5 | } 6 | }, 7 | mounted() { 8 | // In order to fix the click on menu on the ios device will trigger the mouseleave bug 9 | this.fixBugIniOS() 10 | }, 11 | methods: { 12 | fixBugIniOS() { 13 | const $subMenu = this.$refs.subMenu 14 | if ($subMenu) { 15 | const handleMouseleave = $subMenu.handleMouseleave 16 | $subMenu.handleMouseleave = (e) => { 17 | if (this.device === 'mobile') { 18 | return 19 | } 20 | handleMouseleave(e) 21 | } 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ruoyi-ui/src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 24 | 29 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/code.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/druid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/peoples.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/utils/generator/drawingDefault.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | layout: 'colFormItem', 4 | tagIcon: 'input', 5 | label: '手机号', 6 | vModel: 'mobile', 7 | formId: 6, 8 | tag: 'el-input', 9 | placeholder: '请输入手机号', 10 | defaultValue: '', 11 | span: 24, 12 | style: { width: '100%' }, 13 | clearable: true, 14 | prepend: '', 15 | append: '', 16 | 'prefix-icon': 'el-icon-mobile', 17 | 'suffix-icon': '', 18 | maxlength: 11, 19 | 'show-word-limit': true, 20 | readonly: false, 21 | disabled: false, 22 | required: true, 23 | changeTag: true, 24 | regList: [{ 25 | pattern: '/^1(3|4|5|7|8|9)\\d{9}$/', 26 | message: '手机号格式错误' 27 | }] 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/input.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/server.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.quartz.task; 2 | 3 | import org.springframework.stereotype.Component; 4 | import com.ruoyi.common.utils.StringUtils; 5 | 6 | /** 7 | * 定时任务调度测试 8 | * 9 | * @author ruoyi 10 | */ 11 | @Component("ryTask") 12 | public class RyTask 13 | { 14 | public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) 15 | { 16 | System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i)); 17 | } 18 | 19 | public void ryParams(String params) 20 | { 21 | System.out.println("执行有参方法:" + params); 22 | } 23 | 24 | public void ryNoParams() 25 | { 26 | System.out.println("执行无参方法"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ruoyi-ui/src/directive/permission/hasRole.js: -------------------------------------------------------------------------------- 1 | /** 2 | * v-hasRole 角色权限处理 3 | * Copyright (c) 2019 ruoyi 4 | */ 5 | 6 | import store from '@/store' 7 | 8 | export default { 9 | inserted(el, binding, vnode) { 10 | const { value } = binding 11 | const super_admin = "admin"; 12 | const roles = store.getters && store.getters.roles 13 | 14 | if (value && value instanceof Array && value.length > 0) { 15 | const roleFlag = value 16 | 17 | const hasRole = roles.some(role => { 18 | return super_admin === role || roleFlag.includes(role) 19 | }) 20 | 21 | if (!hasRole) { 22 | el.parentNode && el.parentNode.removeChild(el) 23 | } 24 | } else { 25 | throw new Error(`请设置角色权限标签值"`) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/AuthenticationContextHolder.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.security.context; 2 | 3 | import org.springframework.security.core.Authentication; 4 | 5 | /** 6 | * 身份验证信息 7 | * 8 | * @author ruoyi 9 | */ 10 | public class AuthenticationContextHolder 11 | { 12 | private static final ThreadLocal contextHolder = new ThreadLocal<>(); 13 | 14 | public static Authentication getContext() 15 | { 16 | return contextHolder.get(); 17 | } 18 | 19 | public static void setContext(Authentication context) 20 | { 21 | contextHolder.set(context); 22 | } 23 | 24 | public static void clearContext() 25 | { 26 | contextHolder.remove(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ruoyi-ui/src/layout/components/Sidebar/Item.vue: -------------------------------------------------------------------------------- 1 | 34 | -------------------------------------------------------------------------------- /ruoyi-ui/src/api/monitor/logininfor.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 查询登录日志列表 4 | export function list(query) { 5 | return request({ 6 | url: '/monitor/logininfor/list', 7 | method: 'get', 8 | params: query 9 | }) 10 | } 11 | 12 | // 删除登录日志 13 | export function delLogininfor(infoId) { 14 | return request({ 15 | url: '/monitor/logininfor/' + infoId, 16 | method: 'delete' 17 | }) 18 | } 19 | 20 | // 解锁用户登录状态 21 | export function unlockLogininfor(userName) { 22 | return request({ 23 | url: '/monitor/logininfor/unlock/' + userName, 24 | method: 'get' 25 | }) 26 | } 27 | 28 | // 清空登录日志 29 | export function cleanLogininfor() { 30 | return request({ 31 | url: '/monitor/logininfor/clean', 32 | method: 'delete' 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/textarea.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.web.controller.tool; 2 | 3 | import org.springframework.security.access.prepost.PreAuthorize; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import com.ruoyi.common.core.controller.BaseController; 8 | 9 | /** 10 | * swagger 接口 11 | * 12 | * @author ruoyi 13 | */ 14 | @Controller 15 | @RequestMapping("/tool/swagger") 16 | public class SwaggerController extends BaseController 17 | { 18 | @PreAuthorize("@ss.hasPermi('tool:swagger:view')") 19 | @GetMapping() 20 | public String index() 21 | { 22 | return redirect("/swagger-ui.html"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /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-ui/src/assets/icons/svg/time.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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/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/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[] payload() default {}; 27 | } 28 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/nested.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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/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-ui/src/directive/index.js: -------------------------------------------------------------------------------- 1 | import hasRole from './permission/hasRole' 2 | import hasPermi from './permission/hasPermi' 3 | import dialogDrag from './dialog/drag' 4 | import dialogDragWidth from './dialog/dragWidth' 5 | import dialogDragHeight from './dialog/dragHeight' 6 | import clipboard from './module/clipboard' 7 | 8 | const install = function(Vue) { 9 | Vue.directive('hasRole', hasRole) 10 | Vue.directive('hasPermi', hasPermi) 11 | Vue.directive('clipboard', clipboard) 12 | Vue.directive('dialogDrag', dialogDrag) 13 | Vue.directive('dialogDragWidth', dialogDragWidth) 14 | Vue.directive('dialogDragHeight', dialogDragHeight) 15 | } 16 | 17 | if (window.Vue) { 18 | window['hasRole'] = hasRole 19 | window['hasPermi'] = hasPermi 20 | Vue.use(install); // eslint-disable-line 21 | } 22 | 23 | export default install 24 | -------------------------------------------------------------------------------- /ruoyi-ui/src/directive/permission/hasPermi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * v-hasPermi 操作权限处理 3 | * Copyright (c) 2019 ruoyi 4 | */ 5 | 6 | import store from '@/store' 7 | 8 | export default { 9 | inserted(el, binding, vnode) { 10 | const { value } = binding 11 | const all_permission = "*:*:*"; 12 | const permissions = store.getters && store.getters.permissions 13 | 14 | if (value && value instanceof Array && value.length > 0) { 15 | const permissionFlag = value 16 | 17 | const hasPermissions = permissions.some(permission => { 18 | return all_permission === permission || permissionFlag.includes(permission) 19 | }) 20 | 21 | if (!hasPermissions) { 22 | el.parentNode && el.parentNode.removeChild(el) 23 | } 24 | } else { 25 | throw new Error(`请设置操作权限标签值`) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /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/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-ui/src/store/getters.js: -------------------------------------------------------------------------------- 1 | const getters = { 2 | sidebar: state => state.app.sidebar, 3 | size: state => state.app.size, 4 | device: state => state.app.device, 5 | dict: state => state.dict.dict, 6 | visitedViews: state => state.tagsView.visitedViews, 7 | cachedViews: state => state.tagsView.cachedViews, 8 | token: state => state.user.token, 9 | avatar: state => state.user.avatar, 10 | name: state => state.user.name, 11 | introduction: state => state.user.introduction, 12 | roles: state => state.user.roles, 13 | permissions: state => state.user.permissions, 14 | permission_routes: state => state.permission.routes, 15 | topbarRouters:state => state.permission.topbarRouters, 16 | defaultRoutes:state => state.permission.defaultRoutes, 17 | sidebarRouters:state => state.permission.sidebarRouters, 18 | } 19 | export default getters 20 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 targetDataSources) 15 | { 16 | super.setDefaultTargetDataSource(defaultTargetDataSource); 17 | super.setTargetDataSources(targetDataSources); 18 | super.afterPropertiesSet(); 19 | } 20 | 21 | @Override 22 | protected Object determineCurrentLookupKey() 23 | { 24 | return DynamicDataSourceContextHolder.getDataSourceType(); 25 | } 26 | } -------------------------------------------------------------------------------- /ruoyi-system/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ruoyi 7 | com.ruoyi 8 | 3.8.4 9 | 10 | 4.0.0 11 | 12 | ruoyi-system 13 | 14 | 15 | system系统模块 16 | 17 | 18 | 19 | 20 | 21 | 22 | com.ruoyi 23 | ruoyi-common 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/row.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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-ui/src/assets/icons/svg/monitor.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/components/iFrame/index.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 48 | -------------------------------------------------------------------------------- /ruoyi-ui/src/api/system/menu.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 查询菜单列表 4 | export function listMenu(query) { 5 | return request({ 6 | url: '/system/menu/list', 7 | method: 'get', 8 | params: query 9 | }) 10 | } 11 | 12 | // 查询菜单详细 13 | export function getMenu(menuId) { 14 | return request({ 15 | url: '/system/menu/' + menuId, 16 | method: 'get' 17 | }) 18 | } 19 | 20 | // 查询菜单下拉树结构 21 | export function treeselect() { 22 | return request({ 23 | url: '/system/menu/treeselect', 24 | method: 'get' 25 | }) 26 | } 27 | 28 | // 根据角色ID查询菜单下拉树结构 29 | export function roleMenuTreeselect(roleId) { 30 | return request({ 31 | url: '/system/menu/roleMenuTreeselect/' + roleId, 32 | method: 'get' 33 | }) 34 | } 35 | 36 | // 新增菜单 37 | export function addMenu(data) { 38 | return request({ 39 | url: '/system/menu', 40 | method: 'post', 41 | data: data 42 | }) 43 | } 44 | 45 | // 修改菜单 46 | export function updateMenu(data) { 47 | return request({ 48 | url: '/system/menu', 49 | method: 'put', 50 | data: data 51 | }) 52 | } 53 | 54 | // 删除菜单 55 | export function delMenu(menuId) { 56 | return request({ 57 | url: '/system/menu/' + menuId, 58 | method: 'delete' 59 | }) 60 | } -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/checkbox.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/language.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.web.domain.server; 2 | 3 | import com.ruoyi.common.utils.Arith; 4 | 5 | /** 6 | * 內存相关信息 7 | * 8 | * @author ruoyi 9 | */ 10 | public class Mem 11 | { 12 | /** 13 | * 内存总量 14 | */ 15 | private double total; 16 | 17 | /** 18 | * 已用内存 19 | */ 20 | private double used; 21 | 22 | /** 23 | * 剩余内存 24 | */ 25 | private double free; 26 | 27 | public double getTotal() 28 | { 29 | return Arith.div(total, (1024 * 1024 * 1024), 2); 30 | } 31 | 32 | public void setTotal(long total) 33 | { 34 | this.total = total; 35 | } 36 | 37 | public double getUsed() 38 | { 39 | return Arith.div(used, (1024 * 1024 * 1024), 2); 40 | } 41 | 42 | public void setUsed(long used) 43 | { 44 | this.used = used; 45 | } 46 | 47 | public double getFree() 48 | { 49 | return Arith.div(free, (1024 * 1024 * 1024), 2); 50 | } 51 | 52 | public void setFree(long free) 53 | { 54 | this.free = free; 55 | } 56 | 57 | public double getUsage() 58 | { 59 | return Arith.mul(Arith.div(used, total, 4), 100); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.quartz.service; 2 | 3 | import java.util.List; 4 | import com.ruoyi.quartz.domain.SysJobLog; 5 | 6 | /** 7 | * 定时任务调度日志信息信息 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysJobLogService 12 | { 13 | /** 14 | * 获取quartz调度器日志的计划任务 15 | * 16 | * @param jobLog 调度日志信息 17 | * @return 调度任务日志集合 18 | */ 19 | public List selectJobLogList(SysJobLog jobLog); 20 | 21 | /** 22 | * 通过调度任务日志ID查询调度信息 23 | * 24 | * @param jobLogId 调度任务日志ID 25 | * @return 调度任务日志对象信息 26 | */ 27 | public SysJobLog selectJobLogById(Long jobLogId); 28 | 29 | /** 30 | * 新增任务日志 31 | * 32 | * @param jobLog 调度日志信息 33 | */ 34 | public void addJobLog(SysJobLog jobLog); 35 | 36 | /** 37 | * 批量删除调度日志信息 38 | * 39 | * @param logIds 需要删除的日志ID 40 | * @return 结果 41 | */ 42 | public int deleteJobLogByIds(Long[] logIds); 43 | 44 | /** 45 | * 删除任务日志 46 | * 47 | * @param jobId 调度日志ID 48 | * @return 结果 49 | */ 50 | public int deleteJobLogById(Long jobId); 51 | 52 | /** 53 | * 清空任务日志 54 | */ 55 | public void cleanJobLog(); 56 | } 57 | -------------------------------------------------------------------------------- /ruoyi-ui/src/api/system/dict/type.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 查询字典类型列表 4 | export function listType(query) { 5 | return request({ 6 | url: '/system/dict/type/list', 7 | method: 'get', 8 | params: query 9 | }) 10 | } 11 | 12 | // 查询字典类型详细 13 | export function getType(dictId) { 14 | return request({ 15 | url: '/system/dict/type/' + dictId, 16 | method: 'get' 17 | }) 18 | } 19 | 20 | // 新增字典类型 21 | export function addType(data) { 22 | return request({ 23 | url: '/system/dict/type', 24 | method: 'post', 25 | data: data 26 | }) 27 | } 28 | 29 | // 修改字典类型 30 | export function updateType(data) { 31 | return request({ 32 | url: '/system/dict/type', 33 | method: 'put', 34 | data: data 35 | }) 36 | } 37 | 38 | // 删除字典类型 39 | export function delType(dictId) { 40 | return request({ 41 | url: '/system/dict/type/' + dictId, 42 | method: 'delete' 43 | }) 44 | } 45 | 46 | // 刷新字典缓存 47 | export function refreshCache() { 48 | return request({ 49 | url: '/system/dict/type/refreshCache', 50 | method: 'delete' 51 | }) 52 | } 53 | 54 | // 获取字典选择框列表 55 | export function optionselect() { 56 | return request({ 57 | url: '/system/dict/type/optionselect', 58 | method: 'get' 59 | }) 60 | } -------------------------------------------------------------------------------- /ruoyi-ui/src/directive/dialog/dragWidth.js: -------------------------------------------------------------------------------- 1 | /** 2 | * v-dialogDragWidth 可拖动弹窗宽度(右侧边) 3 | * Copyright (c) 2019 ruoyi 4 | */ 5 | 6 | export default { 7 | bind(el) { 8 | const dragDom = el.querySelector('.el-dialog'); 9 | const lineEl = document.createElement('div'); 10 | lineEl.style = 'width: 5px; background: inherit; height: 80%; position: absolute; right: 0; top: 0; bottom: 0; margin: auto; z-index: 1; cursor: w-resize;'; 11 | lineEl.addEventListener('mousedown', 12 | function (e) { 13 | // 鼠标按下,计算当前元素距离可视区的距离 14 | const disX = e.clientX - el.offsetLeft; 15 | // 当前宽度 16 | const curWidth = dragDom.offsetWidth; 17 | document.onmousemove = function (e) { 18 | e.preventDefault(); // 移动时禁用默认事件 19 | // 通过事件委托,计算移动的距离 20 | const l = e.clientX - disX; 21 | dragDom.style.width = `${curWidth + l}px`; 22 | }; 23 | document.onmouseup = function (e) { 24 | document.onmousemove = null; 25 | document.onmouseup = null; 26 | }; 27 | }, false); 28 | dragDom.appendChild(lineEl); 29 | } 30 | } -------------------------------------------------------------------------------- /ruoyi-ui/src/utils/jsencrypt.js: -------------------------------------------------------------------------------- 1 | import JSEncrypt from 'jsencrypt/bin/jsencrypt.min' 2 | 3 | // 密钥对生成 http://web.chacuo.net/netrsakeypair 4 | 5 | const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n' + 6 | 'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' 7 | 8 | const privateKey = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n' + 9 | '7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n' + 10 | 'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n' + 11 | 'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n' + 12 | 'cSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\n' + 13 | 'DQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\n' + 14 | 'YhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\n' + 15 | 'UP8iWi1Qw0Y=' 16 | 17 | // 加密 18 | export function encrypt(txt) { 19 | const encryptor = new JSEncrypt() 20 | encryptor.setPublicKey(publicKey) // 设置公钥 21 | return encryptor.encrypt(txt) // 对数据进行加密 22 | } 23 | 24 | // 解密 25 | export function decrypt(txt) { 26 | const encryptor = new JSEncrypt() 27 | encryptor.setPrivateKey(privateKey) // 设置私钥 28 | return encryptor.decrypt(txt) // 对数据进行解密 29 | } 30 | 31 | -------------------------------------------------------------------------------- /ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.system.service; 2 | 3 | import com.ruoyi.common.core.domain.model.LoginUser; 4 | import com.ruoyi.system.domain.SysUserOnline; 5 | 6 | /** 7 | * 在线用户 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysUserOnlineService 12 | { 13 | /** 14 | * 通过登录地址查询信息 15 | * 16 | * @param ipaddr 登录地址 17 | * @param user 用户信息 18 | * @return 在线用户信息 19 | */ 20 | public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user); 21 | 22 | /** 23 | * 通过用户名称查询信息 24 | * 25 | * @param userName 用户名称 26 | * @param user 用户信息 27 | * @return 在线用户信息 28 | */ 29 | public SysUserOnline selectOnlineByUserName(String userName, LoginUser user); 30 | 31 | /** 32 | * 通过登录地址/用户名称查询信息 33 | * 34 | * @param ipaddr 登录地址 35 | * @param userName 用户名称 36 | * @param user 用户信息 37 | * @return 在线用户信息 38 | */ 39 | public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user); 40 | 41 | /** 42 | * 设置在线用户信息 43 | * 44 | * @param user 用户信息 45 | * @return 在线用户 46 | */ 47 | public SysUserOnline loginUserToUserOnline(LoginUser user); 48 | } 49 | -------------------------------------------------------------------------------- /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-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 | user.logout.success=退出成功 13 | 14 | length.not.valid=长度必须在{min}到{max}个字符之间 15 | 16 | user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 17 | user.password.not.valid=* 5-50个字符 18 | 19 | user.email.not.valid=邮箱格式错误 20 | user.mobile.phone.number.not.valid=手机号格式错误 21 | user.login.success=登录成功 22 | user.register.success=注册成功 23 | user.notfound=请重新登录 24 | user.forcelogout=管理员强制退出,请重新登录 25 | user.unknown.error=未知错误,请重新登录 26 | 27 | ##文件上传消息 28 | upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! 29 | upload.filename.exceed.length=上传的文件名最长{0}个字符 30 | 31 | ##权限 32 | no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] 33 | no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] 34 | no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] 35 | no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] 36 | no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] 37 | no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] 38 | -------------------------------------------------------------------------------- /ruoyi-quartz/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ruoyi 7 | com.ruoyi 8 | 3.8.4 9 | 10 | 4.0.0 11 | 12 | ruoyi-quartz 13 | 14 | 15 | quartz定时任务 16 | 17 | 18 | 19 | 20 | 21 | 22 | org.quartz-scheduler 23 | quartz 24 | 25 | 26 | com.mchange 27 | c3p0 28 | 29 | 30 | 31 | 32 | 33 | 34 | com.ruoyi 35 | ruoyi-common 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | delete from sys_user_post where user_id=#{userId} 14 | 15 | 16 | 19 | 20 | 21 | delete from sys_user_post where user_id in 22 | 23 | #{userId} 24 | 25 | 26 | 27 | 28 | insert into sys_user_post(user_id, post_id) values 29 | 30 | (#{item.userId},#{item.postId}) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /ruoyi-ui/src/api/system/config.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 查询参数列表 4 | export function listConfig(query) { 5 | return request({ 6 | url: '/system/config/list', 7 | method: 'get', 8 | params: query 9 | }) 10 | } 11 | 12 | // 查询参数详细 13 | export function getConfig(configId) { 14 | return request({ 15 | url: '/system/config/' + configId, 16 | method: 'get' 17 | }) 18 | } 19 | 20 | // 根据参数键名查询参数值 21 | export function getConfigKey(configKey) { 22 | return request({ 23 | url: '/system/config/configKey/' + configKey, 24 | method: 'get' 25 | }) 26 | } 27 | 28 | // 新增参数配置 29 | export function addConfig(data) { 30 | return request({ 31 | url: '/system/config', 32 | method: 'post', 33 | data: data 34 | }) 35 | } 36 | 37 | // 修改参数配置 38 | export function updateConfig(data) { 39 | return request({ 40 | url: '/system/config', 41 | method: 'put', 42 | data: data 43 | }) 44 | } 45 | 46 | // 删除参数配置 47 | export function delConfig(configId) { 48 | return request({ 49 | url: '/system/config/' + configId, 50 | method: 'delete' 51 | }) 52 | } 53 | 54 | // 刷新参数缓存 55 | export function refreshCache() { 56 | return request({ 57 | url: '/system/config/refreshCache', 58 | method: 'delete' 59 | }) 60 | } 61 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/eye-open.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | delete from sys_role_menu where role_id=#{roleId} 18 | 19 | 20 | 21 | delete from sys_role_menu where role_id in 22 | 23 | #{roleId} 24 | 25 | 26 | 27 | 28 | insert into sys_role_menu(role_id, menu_id) values 29 | 30 | (#{item.roleId},#{item.menuId}) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /ruoyi-generator/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ruoyi 7 | com.ruoyi 8 | 3.8.4 9 | 10 | 4.0.0 11 | 12 | ruoyi-generator 13 | 14 | 15 | generator代码生成 16 | 17 | 18 | 19 | 20 | 21 | 22 | org.apache.velocity 23 | velocity-engine-core 24 | 25 | 26 | 27 | 28 | commons-collections 29 | commons-collections 30 | 31 | 32 | 33 | 34 | com.ruoyi 35 | ruoyi-common 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | delete from sys_role_dept where role_id=#{roleId} 14 | 15 | 16 | 19 | 20 | 21 | delete from sys_role_dept where role_id in 22 | 23 | #{roleId} 24 | 25 | 26 | 27 | 28 | insert into sys_role_dept(role_id, dept_id) values 29 | 30 | (#{item.roleId},#{item.deptId}) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /ruoyi-ui/src/components/Screenfull/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 47 | 48 | 58 | -------------------------------------------------------------------------------- /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-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-ui/src/api/monitor/cache.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 查询缓存详细 4 | export function getCache() { 5 | return request({ 6 | url: '/monitor/cache', 7 | method: 'get' 8 | }) 9 | } 10 | 11 | // 查询缓存名称列表 12 | export function listCacheName() { 13 | return request({ 14 | url: '/monitor/cache/getNames', 15 | method: 'get' 16 | }) 17 | } 18 | 19 | // 查询缓存键名列表 20 | export function listCacheKey(cacheName) { 21 | return request({ 22 | url: '/monitor/cache/getKeys/' + cacheName, 23 | method: 'get' 24 | }) 25 | } 26 | 27 | // 查询缓存内容 28 | export function getCacheValue(cacheName, cacheKey) { 29 | return request({ 30 | url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey, 31 | method: 'get' 32 | }) 33 | } 34 | 35 | // 清理指定名称缓存 36 | export function clearCacheName(cacheName) { 37 | return request({ 38 | url: '/monitor/cache/clearCacheName/' + cacheName, 39 | method: 'delete' 40 | }) 41 | } 42 | 43 | // 清理指定键名缓存 44 | export function clearCacheKey(cacheKey) { 45 | return request({ 46 | url: '/monitor/cache/clearCacheKey/' + cacheKey, 47 | method: 'delete' 48 | }) 49 | } 50 | 51 | // 清理全部缓存 52 | export function clearCacheAll() { 53 | return request({ 54 | url: '/monitor/cache/clearCacheAll', 55 | method: 'delete' 56 | }) 57 | } 58 | -------------------------------------------------------------------------------- /ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.system.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.system.domain.SysNotice; 5 | 6 | /** 7 | * 通知公告表 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysNoticeMapper 12 | { 13 | /** 14 | * 查询公告信息 15 | * 16 | * @param noticeId 公告ID 17 | * @return 公告信息 18 | */ 19 | public SysNotice selectNoticeById(Long noticeId); 20 | 21 | /** 22 | * 查询公告列表 23 | * 24 | * @param notice 公告信息 25 | * @return 公告集合 26 | */ 27 | public List selectNoticeList(SysNotice notice); 28 | 29 | /** 30 | * 新增公告 31 | * 32 | * @param notice 公告信息 33 | * @return 结果 34 | */ 35 | public int insertNotice(SysNotice notice); 36 | 37 | /** 38 | * 修改公告 39 | * 40 | * @param notice 公告信息 41 | * @return 结果 42 | */ 43 | public int updateNotice(SysNotice notice); 44 | 45 | /** 46 | * 批量删除公告 47 | * 48 | * @param noticeId 公告ID 49 | * @return 结果 50 | */ 51 | public int deleteNoticeById(Long noticeId); 52 | 53 | /** 54 | * 批量删除公告信息 55 | * 56 | * @param noticeIds 需要删除的公告ID 57 | * @return 结果 58 | */ 59 | public int deleteNoticeByIds(Long[] noticeIds); 60 | } 61 | -------------------------------------------------------------------------------- /ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.manager; 2 | 3 | import java.util.TimerTask; 4 | import java.util.concurrent.ScheduledExecutorService; 5 | import java.util.concurrent.TimeUnit; 6 | import com.ruoyi.common.utils.Threads; 7 | import com.ruoyi.common.utils.spring.SpringUtils; 8 | 9 | /** 10 | * 异步任务管理器 11 | * 12 | * @author ruoyi 13 | */ 14 | public class AsyncManager 15 | { 16 | /** 17 | * 操作延迟10毫秒 18 | */ 19 | private final int OPERATE_DELAY_TIME = 10; 20 | 21 | /** 22 | * 异步操作任务调度线程池 23 | */ 24 | private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService"); 25 | 26 | /** 27 | * 单例模式 28 | */ 29 | private AsyncManager(){} 30 | 31 | private static AsyncManager me = new AsyncManager(); 32 | 33 | public static AsyncManager me() 34 | { 35 | return me; 36 | } 37 | 38 | /** 39 | * 执行任务 40 | * 41 | * @param task 任务 42 | */ 43 | public void execute(TimerTask task) 44 | { 45 | executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); 46 | } 47 | 48 | /** 49 | * 停止任务线程池 50 | */ 51 | public void shutdown() 52 | { 53 | Threads.shutdownAndAwaitTermination(executor); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.system.service; 2 | 3 | import java.util.List; 4 | import com.ruoyi.system.domain.SysNotice; 5 | 6 | /** 7 | * 公告 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysNoticeService 12 | { 13 | /** 14 | * 查询公告信息 15 | * 16 | * @param noticeId 公告ID 17 | * @return 公告信息 18 | */ 19 | public SysNotice selectNoticeById(Long noticeId); 20 | 21 | /** 22 | * 查询公告列表 23 | * 24 | * @param notice 公告信息 25 | * @return 公告集合 26 | */ 27 | public List selectNoticeList(SysNotice notice); 28 | 29 | /** 30 | * 新增公告 31 | * 32 | * @param notice 公告信息 33 | * @return 结果 34 | */ 35 | public int insertNotice(SysNotice notice); 36 | 37 | /** 38 | * 修改公告 39 | * 40 | * @param notice 公告信息 41 | * @return 结果 42 | */ 43 | public int updateNotice(SysNotice notice); 44 | 45 | /** 46 | * 删除公告信息 47 | * 48 | * @param noticeId 公告ID 49 | * @return 结果 50 | */ 51 | public int deleteNoticeById(Long noticeId); 52 | 53 | /** 54 | * 批量删除公告信息 55 | * 56 | * @param noticeIds 需要删除的公告ID 57 | * @return 结果 58 | */ 59 | public int deleteNoticeByIds(Long[] noticeIds); 60 | } 61 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/validCode.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/radio.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/select.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/components/Hamburger/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 32 | 33 | 45 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/upload.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/components/DictData/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import store from '@/store' 3 | import DataDict from '@/utils/dict' 4 | import { getDicts as getDicts } from '@/api/system/dict/data' 5 | 6 | function searchDictByKey(dict, key) { 7 | if (key == null && key == "") { 8 | return null 9 | } 10 | try { 11 | for (let i = 0; i < dict.length; i++) { 12 | if (dict[i].key == key) { 13 | return dict[i].value 14 | } 15 | } 16 | } catch (e) { 17 | return null 18 | } 19 | } 20 | 21 | function install() { 22 | Vue.use(DataDict, { 23 | metas: { 24 | '*': { 25 | labelField: 'dictLabel', 26 | valueField: 'dictValue', 27 | request(dictMeta) { 28 | const storeDict = searchDictByKey(store.getters.dict, dictMeta.type) 29 | if (storeDict) { 30 | return new Promise(resolve => { resolve(storeDict) }) 31 | } else { 32 | return new Promise((resolve, reject) => { 33 | getDicts(dictMeta.type).then(res => { 34 | store.dispatch('dict/setDict', { key: dictMeta.type, value: res.data }) 35 | resolve(res.data) 36 | }).catch(error => { 37 | reject(error) 38 | }) 39 | }) 40 | } 41 | }, 42 | }, 43 | }, 44 | }) 45 | } 46 | 47 | export default { 48 | install, 49 | } -------------------------------------------------------------------------------- /ruoyi-ui/src/layout/components/AppMain.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 28 | 29 | 53 | 54 | 62 | -------------------------------------------------------------------------------- /ruoyi-ui/src/components/DictTag/index.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 48 | -------------------------------------------------------------------------------- /ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.quartz.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.quartz.domain.SysJob; 5 | 6 | /** 7 | * 调度任务信息 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysJobMapper 12 | { 13 | /** 14 | * 查询调度任务日志集合 15 | * 16 | * @param job 调度信息 17 | * @return 操作日志集合 18 | */ 19 | public List selectJobList(SysJob job); 20 | 21 | /** 22 | * 查询所有调度任务 23 | * 24 | * @return 调度任务列表 25 | */ 26 | public List selectJobAll(); 27 | 28 | /** 29 | * 通过调度ID查询调度任务信息 30 | * 31 | * @param jobId 调度ID 32 | * @return 角色对象信息 33 | */ 34 | public SysJob selectJobById(Long jobId); 35 | 36 | /** 37 | * 通过调度ID删除调度任务信息 38 | * 39 | * @param jobId 调度ID 40 | * @return 结果 41 | */ 42 | public int deleteJobById(Long jobId); 43 | 44 | /** 45 | * 批量删除调度任务信息 46 | * 47 | * @param ids 需要删除的数据ID 48 | * @return 结果 49 | */ 50 | public int deleteJobByIds(Long[] ids); 51 | 52 | /** 53 | * 修改调度任务信息 54 | * 55 | * @param job 调度任务信息 56 | * @return 结果 57 | */ 58 | public int updateJob(SysJob job); 59 | 60 | /** 61 | * 新增调度任务信息 62 | * 63 | * @param job 调度任务信息 64 | * @return 结果 65 | */ 66 | public int insertJob(SysJob job); 67 | } 68 | -------------------------------------------------------------------------------- /ruoyi-ui/src/api/monitor/job.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 查询定时任务调度列表 4 | export function listJob(query) { 5 | return request({ 6 | url: '/monitor/job/list', 7 | method: 'get', 8 | params: query 9 | }) 10 | } 11 | 12 | // 查询定时任务调度详细 13 | export function getJob(jobId) { 14 | return request({ 15 | url: '/monitor/job/' + jobId, 16 | method: 'get' 17 | }) 18 | } 19 | 20 | // 新增定时任务调度 21 | export function addJob(data) { 22 | return request({ 23 | url: '/monitor/job', 24 | method: 'post', 25 | data: data 26 | }) 27 | } 28 | 29 | // 修改定时任务调度 30 | export function updateJob(data) { 31 | return request({ 32 | url: '/monitor/job', 33 | method: 'put', 34 | data: data 35 | }) 36 | } 37 | 38 | // 删除定时任务调度 39 | export function delJob(jobId) { 40 | return request({ 41 | url: '/monitor/job/' + jobId, 42 | method: 'delete' 43 | }) 44 | } 45 | 46 | // 任务状态修改 47 | export function changeJobStatus(jobId, status) { 48 | const data = { 49 | jobId, 50 | status 51 | } 52 | return request({ 53 | url: '/monitor/job/changeStatus', 54 | method: 'put', 55 | data: data 56 | }) 57 | } 58 | 59 | 60 | // 定时任务立即执行一次 61 | export function runJob(jobId, jobGroup) { 62 | const data = { 63 | jobId, 64 | jobGroup 65 | } 66 | return request({ 67 | url: '/monitor/job/run', 68 | method: 'put', 69 | data: data 70 | }) 71 | } -------------------------------------------------------------------------------- /ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.quartz.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.quartz.domain.SysJobLog; 5 | 6 | /** 7 | * 调度任务日志信息 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysJobLogMapper 12 | { 13 | /** 14 | * 获取quartz调度器日志的计划任务 15 | * 16 | * @param jobLog 调度日志信息 17 | * @return 调度任务日志集合 18 | */ 19 | public List selectJobLogList(SysJobLog jobLog); 20 | 21 | /** 22 | * 查询所有调度任务日志 23 | * 24 | * @return 调度任务日志列表 25 | */ 26 | public List selectJobLogAll(); 27 | 28 | /** 29 | * 通过调度任务日志ID查询调度信息 30 | * 31 | * @param jobLogId 调度任务日志ID 32 | * @return 调度任务日志对象信息 33 | */ 34 | public SysJobLog selectJobLogById(Long jobLogId); 35 | 36 | /** 37 | * 新增任务日志 38 | * 39 | * @param jobLog 调度日志信息 40 | * @return 结果 41 | */ 42 | public int insertJobLog(SysJobLog jobLog); 43 | 44 | /** 45 | * 批量删除调度日志信息 46 | * 47 | * @param logIds 需要删除的数据ID 48 | * @return 结果 49 | */ 50 | public int deleteJobLogByIds(Long[] logIds); 51 | 52 | /** 53 | * 删除任务日志 54 | * 55 | * @param jobId 调度日志ID 56 | * @return 结果 57 | */ 58 | public int deleteJobLogById(Long jobId); 59 | 60 | /** 61 | * 清空任务日志 62 | */ 63 | public void cleanJobLog(); 64 | } 65 | -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/404.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.security.handle; 2 | 3 | import java.io.IOException; 4 | import java.io.Serializable; 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | import org.springframework.security.core.AuthenticationException; 8 | import org.springframework.security.web.AuthenticationEntryPoint; 9 | import org.springframework.stereotype.Component; 10 | import com.alibaba.fastjson2.JSON; 11 | import com.ruoyi.common.constant.HttpStatus; 12 | import com.ruoyi.common.core.domain.AjaxResult; 13 | import com.ruoyi.common.utils.ServletUtils; 14 | import com.ruoyi.common.utils.StringUtils; 15 | 16 | /** 17 | * 认证失败处理类 返回未授权 18 | * 19 | * @author ruoyi 20 | */ 21 | @Component 22 | public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable 23 | { 24 | private static final long serialVersionUID = -8970718410437077606L; 25 | 26 | @Override 27 | public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) 28 | throws IOException 29 | { 30 | int code = HttpStatus.UNAUTHORIZED; 31 | String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI()); 32 | ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg))); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /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-ui/src/assets/icons/svg/zip.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-ui/src/utils/dict/DictOptions.js: -------------------------------------------------------------------------------- 1 | import { mergeRecursive } from "@/utils/ruoyi"; 2 | import dictConverter from './DictConverter' 3 | 4 | export const options = { 5 | metas: { 6 | '*': { 7 | /** 8 | * 字典请求,方法签名为function(dictMeta: DictMeta): Promise 9 | */ 10 | request: (dictMeta) => { 11 | console.log(`load dict ${dictMeta.type}`) 12 | return Promise.resolve([]) 13 | }, 14 | /** 15 | * 字典响应数据转换器,方法签名为function(response: Object, dictMeta: DictMeta): DictData 16 | */ 17 | responseConverter, 18 | labelField: 'label', 19 | valueField: 'value', 20 | }, 21 | }, 22 | /** 23 | * 默认标签字段 24 | */ 25 | DEFAULT_LABEL_FIELDS: ['label', 'name', 'title'], 26 | /** 27 | * 默认值字段 28 | */ 29 | DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key'], 30 | } 31 | 32 | /** 33 | * 映射字典 34 | * @param {Object} response 字典数据 35 | * @param {DictMeta} dictMeta 字典元数据 36 | * @returns {DictData} 37 | */ 38 | function responseConverter(response, dictMeta) { 39 | const dicts = response.content instanceof Array ? response.content : response 40 | if (dicts === undefined) { 41 | console.warn(`no dict data of "${dictMeta.type}" found in the response`) 42 | return [] 43 | } 44 | return dicts.map(d => dictConverter(d, dictMeta)) 45 | } 46 | 47 | export function mergeOptions(src) { 48 | mergeRecursive(options, src) 49 | } 50 | 51 | export default options 52 | -------------------------------------------------------------------------------- /ruoyi-ui/src/layout/mixin/ResizeHandler.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | 3 | const { body } = document 4 | const WIDTH = 992 // refer to Bootstrap's responsive design 5 | 6 | export default { 7 | watch: { 8 | $route(route) { 9 | if (this.device === 'mobile' && this.sidebar.opened) { 10 | store.dispatch('app/closeSideBar', { withoutAnimation: false }) 11 | } 12 | } 13 | }, 14 | beforeMount() { 15 | window.addEventListener('resize', this.$_resizeHandler) 16 | }, 17 | beforeDestroy() { 18 | window.removeEventListener('resize', this.$_resizeHandler) 19 | }, 20 | mounted() { 21 | const isMobile = this.$_isMobile() 22 | if (isMobile) { 23 | store.dispatch('app/toggleDevice', 'mobile') 24 | store.dispatch('app/closeSideBar', { withoutAnimation: true }) 25 | } 26 | }, 27 | methods: { 28 | // use $_ for mixins properties 29 | // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential 30 | $_isMobile() { 31 | const rect = body.getBoundingClientRect() 32 | return rect.width - 1 < WIDTH 33 | }, 34 | $_resizeHandler() { 35 | if (!document.hidden) { 36 | const isMobile = this.$_isMobile() 37 | store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') 38 | 39 | if (isMobile) { 40 | store.dispatch('app/closeSideBar', { withoutAnimation: true }) 41 | } 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ruoyi-ui/src/store/modules/settings.js: -------------------------------------------------------------------------------- 1 | import defaultSettings from '@/settings' 2 | 3 | const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings 4 | 5 | const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || '' 6 | const state = { 7 | title: '', 8 | theme: storageSetting.theme || '#409EFF', 9 | sideTheme: storageSetting.sideTheme || sideTheme, 10 | showSettings: showSettings, 11 | topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav, 12 | tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView, 13 | fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader, 14 | sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo, 15 | dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle 16 | } 17 | const mutations = { 18 | CHANGE_SETTING: (state, { key, value }) => { 19 | if (state.hasOwnProperty(key)) { 20 | state[key] = value 21 | } 22 | } 23 | } 24 | 25 | const actions = { 26 | // 修改布局设置 27 | changeSetting({ commit }, data) { 28 | commit('CHANGE_SETTING', data) 29 | }, 30 | // 设置网页标题 31 | setTitle({ commit }, title) { 32 | state.title = title 33 | } 34 | } 35 | 36 | export default { 37 | namespaced: true, 38 | state, 39 | mutations, 40 | actions 41 | } 42 | 43 | -------------------------------------------------------------------------------- /ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.system.service; 2 | 3 | import java.util.List; 4 | import com.ruoyi.common.core.domain.entity.SysDictData; 5 | 6 | /** 7 | * 字典 业务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysDictDataService 12 | { 13 | /** 14 | * 根据条件分页查询字典数据 15 | * 16 | * @param dictData 字典数据信息 17 | * @return 字典数据集合信息 18 | */ 19 | public List selectDictDataList(SysDictData dictData); 20 | 21 | /** 22 | * 根据字典类型和字典键值查询字典数据信息 23 | * 24 | * @param dictType 字典类型 25 | * @param dictValue 字典键值 26 | * @return 字典标签 27 | */ 28 | public String selectDictLabel(String dictType, String dictValue); 29 | 30 | /** 31 | * 根据字典数据ID查询信息 32 | * 33 | * @param dictCode 字典数据ID 34 | * @return 字典数据 35 | */ 36 | public SysDictData selectDictDataById(Long dictCode); 37 | 38 | /** 39 | * 批量删除字典数据信息 40 | * 41 | * @param dictCodes 需要删除的字典数据ID 42 | */ 43 | public void deleteDictDataByIds(Long[] dictCodes); 44 | 45 | /** 46 | * 新增保存字典数据信息 47 | * 48 | * @param dictData 字典数据信息 49 | * @return 结果 50 | */ 51 | public int insertDictData(SysDictData dictData); 52 | 53 | /** 54 | * 修改保存字典数据信息 55 | * 56 | * @param dictData 字典数据信息 57 | * @return 结果 58 | */ 59 | public int updateDictData(SysDictData dictData); 60 | } 61 | -------------------------------------------------------------------------------- /ruoyi-ui/src/utils/permission.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | 3 | /** 4 | * 字符权限校验 5 | * @param {Array} value 校验值 6 | * @returns {Boolean} 7 | */ 8 | export function checkPermi(value) { 9 | if (value && value instanceof Array && value.length > 0) { 10 | const permissions = store.getters && store.getters.permissions 11 | const permissionDatas = value 12 | const all_permission = "*:*:*"; 13 | 14 | const hasPermission = permissions.some(permission => { 15 | return all_permission === permission || permissionDatas.includes(permission) 16 | }) 17 | 18 | if (!hasPermission) { 19 | return false 20 | } 21 | return true 22 | } else { 23 | console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`) 24 | return false 25 | } 26 | } 27 | 28 | /** 29 | * 角色权限校验 30 | * @param {Array} value 校验值 31 | * @returns {Boolean} 32 | */ 33 | export function checkRole(value) { 34 | if (value && value instanceof Array && value.length > 0) { 35 | const roles = store.getters && store.getters.roles 36 | const permissionRoles = value 37 | const super_admin = "admin"; 38 | 39 | const hasRole = roles.some(role => { 40 | return super_admin === role || permissionRoles.includes(role) 41 | }) 42 | 43 | if (!hasRole) { 44 | return false 45 | } 46 | return true 47 | } else { 48 | console.error(`need roles! Like checkRole="['admin','editor']"`) 49 | return false 50 | } 51 | } -------------------------------------------------------------------------------- /ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.generator.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.generator.domain.GenTableColumn; 5 | 6 | /** 7 | * 业务字段 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface GenTableColumnMapper 12 | { 13 | /** 14 | * 根据表名称查询列信息 15 | * 16 | * @param tableName 表名称 17 | * @return 列信息 18 | */ 19 | public List selectDbTableColumnsByName(String tableName); 20 | 21 | /** 22 | * 查询业务字段列表 23 | * 24 | * @param tableId 业务字段编号 25 | * @return 业务字段集合 26 | */ 27 | public List selectGenTableColumnListByTableId(Long tableId); 28 | 29 | /** 30 | * 新增业务字段 31 | * 32 | * @param genTableColumn 业务字段信息 33 | * @return 结果 34 | */ 35 | public int insertGenTableColumn(GenTableColumn genTableColumn); 36 | 37 | /** 38 | * 修改业务字段 39 | * 40 | * @param genTableColumn 业务字段信息 41 | * @return 结果 42 | */ 43 | public int updateGenTableColumn(GenTableColumn genTableColumn); 44 | 45 | /** 46 | * 删除业务字段 47 | * 48 | * @param genTableColumns 列数据 49 | * @return 结果 50 | */ 51 | public int deleteGenTableColumns(List genTableColumns); 52 | 53 | /** 54 | * 批量删除业务字段 55 | * 56 | * @param ids 需要删除的数据ID 57 | * @return 结果 58 | */ 59 | public int deleteGenTableColumnByIds(Long[] ids); 60 | } 61 | -------------------------------------------------------------------------------- /ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.system.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.ruoyi.system.domain.SysUserRole; 6 | 7 | /** 8 | * 用户与角色关联表 数据层 9 | * 10 | * @author ruoyi 11 | */ 12 | public interface SysUserRoleMapper 13 | { 14 | /** 15 | * 通过用户ID删除用户和角色关联 16 | * 17 | * @param userId 用户ID 18 | * @return 结果 19 | */ 20 | public int deleteUserRoleByUserId(Long userId); 21 | 22 | /** 23 | * 批量删除用户和角色关联 24 | * 25 | * @param ids 需要删除的数据ID 26 | * @return 结果 27 | */ 28 | public int deleteUserRole(Long[] ids); 29 | 30 | /** 31 | * 通过角色ID查询角色使用数量 32 | * 33 | * @param roleId 角色ID 34 | * @return 结果 35 | */ 36 | public int countUserRoleByRoleId(Long roleId); 37 | 38 | /** 39 | * 批量新增用户角色信息 40 | * 41 | * @param userRoleList 用户角色列表 42 | * @return 结果 43 | */ 44 | public int batchUserRole(List userRoleList); 45 | 46 | /** 47 | * 删除用户和角色关联信息 48 | * 49 | * @param userRole 用户和角色关联信息 50 | * @return 结果 51 | */ 52 | public int deleteUserRoleInfo(SysUserRole userRole); 53 | 54 | /** 55 | * 批量取消授权用户角色 56 | * 57 | * @param roleId 角色ID 58 | * @param userIds 需要删除的用户数据ID 59 | * @return 结果 60 | */ 61 | public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); 62 | } 63 | -------------------------------------------------------------------------------- /ruoyi-ui/src/components/SvgIcon/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 46 | 47 | 62 | -------------------------------------------------------------------------------- /ruoyi-ui/src/directive/dialog/dragHeight.js: -------------------------------------------------------------------------------- 1 | /** 2 | * v-dialogDragWidth 可拖动弹窗高度(右下角) 3 | * Copyright (c) 2019 ruoyi 4 | */ 5 | 6 | export default { 7 | bind(el) { 8 | const dragDom = el.querySelector('.el-dialog'); 9 | const lineEl = document.createElement('div'); 10 | lineEl.style = 'width: 6px; background: inherit; height: 10px; position: absolute; right: 0; bottom: 0; margin: auto; z-index: 1; cursor: nwse-resize;'; 11 | lineEl.addEventListener('mousedown', 12 | function(e) { 13 | // 鼠标按下,计算当前元素距离可视区的距离 14 | const disX = e.clientX - el.offsetLeft; 15 | const disY = e.clientY - el.offsetTop; 16 | // 当前宽度 高度 17 | const curWidth = dragDom.offsetWidth; 18 | const curHeight = dragDom.offsetHeight; 19 | document.onmousemove = function(e) { 20 | e.preventDefault(); // 移动时禁用默认事件 21 | // 通过事件委托,计算移动的距离 22 | const xl = e.clientX - disX; 23 | const yl = e.clientY - disY 24 | dragDom.style.width = `${curWidth + xl}px`; 25 | dragDom.style.height = `${curHeight + yl}px`; 26 | }; 27 | document.onmouseup = function(e) { 28 | document.onmousemove = null; 29 | document.onmouseup = null; 30 | }; 31 | }, false); 32 | dragDom.appendChild(lineEl); 33 | } 34 | } -------------------------------------------------------------------------------- /ruoyi-ui/src/assets/icons/svg/phone.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.system.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.system.domain.SysConfig; 5 | 6 | /** 7 | * 参数配置 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysConfigMapper 12 | { 13 | /** 14 | * 查询参数配置信息 15 | * 16 | * @param config 参数配置信息 17 | * @return 参数配置信息 18 | */ 19 | public SysConfig selectConfig(SysConfig config); 20 | 21 | /** 22 | * 查询参数配置列表 23 | * 24 | * @param config 参数配置信息 25 | * @return 参数配置集合 26 | */ 27 | public List selectConfigList(SysConfig config); 28 | 29 | /** 30 | * 根据键名查询参数配置信息 31 | * 32 | * @param configKey 参数键名 33 | * @return 参数配置信息 34 | */ 35 | public SysConfig checkConfigKeyUnique(String configKey); 36 | 37 | /** 38 | * 新增参数配置 39 | * 40 | * @param config 参数配置信息 41 | * @return 结果 42 | */ 43 | public int insertConfig(SysConfig config); 44 | 45 | /** 46 | * 修改参数配置 47 | * 48 | * @param config 参数配置信息 49 | * @return 结果 50 | */ 51 | public int updateConfig(SysConfig config); 52 | 53 | /** 54 | * 删除参数配置 55 | * 56 | * @param configId 参数ID 57 | * @return 结果 58 | */ 59 | public int deleteConfigById(Long configId); 60 | 61 | /** 62 | * 批量删除参数信息 63 | * 64 | * @param configIds 需要删除的参数ID 65 | * @return 结果 66 | */ 67 | public int deleteConfigByIds(Long[] configIds); 68 | } 69 | -------------------------------------------------------------------------------- /ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.config; 2 | 3 | import java.nio.charset.Charset; 4 | import org.springframework.data.redis.serializer.RedisSerializer; 5 | import org.springframework.data.redis.serializer.SerializationException; 6 | import com.alibaba.fastjson2.JSON; 7 | import com.alibaba.fastjson2.JSONReader; 8 | import com.alibaba.fastjson2.JSONWriter; 9 | 10 | /** 11 | * Redis使用FastJson序列化 12 | * 13 | * @author ruoyi 14 | */ 15 | public class FastJson2JsonRedisSerializer implements RedisSerializer 16 | { 17 | public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); 18 | 19 | private Class clazz; 20 | 21 | public FastJson2JsonRedisSerializer(Class clazz) 22 | { 23 | super(); 24 | this.clazz = clazz; 25 | } 26 | 27 | @Override 28 | public byte[] serialize(T t) throws SerializationException 29 | { 30 | if (t == null) 31 | { 32 | return new byte[0]; 33 | } 34 | return JSON.toJSONString(t, JSONWriter.Feature.WriteClassName).getBytes(DEFAULT_CHARSET); 35 | } 36 | 37 | @Override 38 | public T deserialize(byte[] bytes) throws SerializationException 39 | { 40 | if (bytes == null || bytes.length <= 0) 41 | { 42 | return null; 43 | } 44 | String str = new String(bytes, DEFAULT_CHARSET); 45 | 46 | return JSON.parseObject(str, clazz, JSONReader.Feature.SupportAutoType); 47 | } 48 | } 49 | --------------------------------------------------------------------------------