diff --git a/README.md b/README.md index a5cae9332..7004f0e50 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,20 @@ [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/blob/master/LICENSE) [![使用IntelliJ IDEA开发维护](https://img.shields.io/badge/IntelliJ%20IDEA-提供支持-blue.svg)](https://www.jetbrains.com/?from=RuoYi-Vue-Plus)
-[![RuoYi-Vue-Plus](https://img.shields.io/badge/RuoYi_Vue_Plus-3.3.0-success.svg)](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus) +[![RuoYi-Vue-Plus](https://img.shields.io/badge/RuoYi_Vue_Plus-3.4.0-success.svg)](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus) [![Spring Boot](https://img.shields.io/badge/Spring%20Boot-2.5-blue.svg)]() [![JDK-8+](https://img.shields.io/badge/JDK-8-green.svg)]() [![JDK-11](https://img.shields.io/badge/JDK-11-green.svg)]() [![JDK-17](https://img.shields.io/badge/JDK-17-green.svg)]() -RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级(不兼容原框架) +> RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级(不兼容原框架) + +> 系统演示: [传送门](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/wikis/系统演示?sort_id=4836388) | 功能介绍 | 使用技术 | 文档地址 | 特性注意事项 | |---|---|---|---| | 当前框架 | RuoYi-Vue-Plus | [RuoYi-Vue-Plus文档](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/wikis/pages) | 重写RuoYi-Vue全方位升级(不兼容原框架) | -| satoken分支 | RuoYi-Vue-Plus-satoken | [satoken分支地址](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/tree/satoken/) | 使用satoken重构权限鉴权(仅供学习不推荐上生产) | +| satoken分支 | RuoYi-Vue-Plus-satoken | [satoken分支地址](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/tree/satoken/) | 使用satoken重构权限鉴权(公测 可尝试上生产) | | 单体分支 | RuoYi-Vue-Plus-fast | [fast分支地址](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/tree/fast/) | 单体应用结构 | | 原框架 | RuoYi-Vue | [RuoYi-Vue官网](http://ruoyi.vip/) | 定期同步需要的功能 | | 前端开发框架 | Vue、Element UI | [Element UI官网](https://element.eleme.cn/#/zh-CN) | | @@ -28,17 +30,16 @@ RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级(不兼 | 数据库框架 | p6spy | [p6spy官网](https://p6spy.readthedocs.io/) | 更强劲的 SQL 分析 | | 多数据源框架 | dynamic-datasource | [dynamic-ds文档](https://www.kancloud.cn/tracy5546/dynamic-datasource/content) | 支持主从与多种类数据库异构 | | 序列化框架 | Jackson | [Jackson官网](https://github.com/FasterXML/jackson) | 统一使用 jackson 高效可靠 | -| 网络框架 | Feign、OkHttp3 | [Feign官网](https://github.com/OpenFeign/feign) | 接口化管理 HTTP 请求 | | Redis客户端 | Redisson | [Redisson文档](https://github.com/redisson/redisson/wiki/%E7%9B%AE%E5%BD%95) | 支持单机、集群配置 | | 分布式限流 | Redisson | [Redisson文档](https://github.com/redisson/redisson/wiki/%E7%9B%AE%E5%BD%95) | 全局、请求IP、集群ID 多种限流 | | 分布式锁 | Lock4j | [Lock4j官网](https://gitee.com/baomidou/lock4j) | 注解锁、工具锁 多种多样 | -| 分布式幂等 | Lock4j | [Lock4j文档](https://gitee.com/baomidou/lock4j) | 基于分布式锁实现 | +| 分布式幂等 | Redisson | [Lock4j文档](https://gitee.com/baomidou/lock4j) | 拦截重复提交 | | 分布式日志 | TLog | [TLog文档](https://yomahub.com/tlog/docs) | 支持跟踪链路日志记录、性能分析、链路排查 | | 分布式任务调度 | Xxl-Job | [Xxl-Job官网](https://www.xuxueli.com/xxl-job/) | 高性能 高可靠 易扩展 | | 文件存储 | Minio | [Minio文档](https://docs.min.io/) | 本地存储 | | 文件存储 | 七牛、阿里、腾讯 | [OSS使用文档](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/wikis/pages?sort_id=4359146&doc_id=1469725) | 云存储 | | 监控框架 | SpringBoot-Admin | [SpringBoot-Admin文档](https://codecentric.github.io/spring-boot-admin/current/) | 全方位服务监控 | -| 校验框架 | Validation | [Validation文档](https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/) | 增强接口安全性、严谨性 | +| 校验框架 | Validation | [Validation文档](https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/) | 增强接口安全性、严谨性 支持国际化 | | Excel框架 | Alibaba EasyExcel | [EasyExcel文档](https://www.yuque.com/easyexcel/doc/easyexcel) | 性能优异 扩展性强 | | 文档框架 | Knife4j | [Knife4j文档](https://doc.xiaominfo.com/knife4j/documentation/) | 美化接口文档 | | 工具类框架 | Hutool、Lombok | [Hutool文档](https://www.hutool.cn/docs/) | 减少代码冗余 增加安全性 | @@ -61,8 +62,7 @@ RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级(不兼 ## 软件架构图 -![Plus部署架构图](https://images.gitee.com/uploads/images/2021/0729/112230_4295e5ce_1766278.png "Plus部署架构图.png") - +![Plus部署架构图](https://images.gitee.com/uploads/images/2021/1112/202137_673ac5d2_1766278.png "Plus部署架构图.png") ## 贡献代码 欢迎各路英雄豪杰 `PR` 代码 请提交到 `dev` 开发分支 统一测试发版 diff --git a/pom.xml b/pom.xml index c7bf0315c..79a18f530 100644 --- a/pom.xml +++ b/pom.xml @@ -6,15 +6,15 @@ com.ruoyi ruoyi-vue-plus - 3.3.0 + 3.4.0 RuoYi-Vue-Plus https://gitee.com/JavaLionLi/RuoYi-Vue-Plus RuoYi-Vue-Plus后台管理系统 - 3.3.0 - 2.5.6 + 3.4.0 + 2.5.7 UTF-8 UTF-8 1.8 @@ -24,19 +24,17 @@ 1.5.22 4.1.2 2.2.11 - 1.7 + 2.3 0.9.1 3.4.3.4 3.9.1 - 5.7.15 - 3.0.3 - 11.6 - 4.9.1 - 2.5.2 - 3.16.3 + 5.7.16 + 4.9.2 + 2.5.4 + 3.16.4 2.2.1 3.4.1 - 1.3.3 + 1.3.4 2.3.0 @@ -120,7 +118,7 @@ org.apache.velocity - velocity + velocity-engine-core ${velocity.version} @@ -168,25 +166,6 @@ ${hutool.version} - - - org.springframework.cloud - spring-cloud-starter-openfeign - ${feign.version} - - - feign-core - io.github.openfeign - - - - - - io.github.openfeign - feign-okhttp - ${feign-okhttp.version} - - com.squareup.okhttp3 okhttp @@ -245,12 +224,6 @@ - - com.yomahub - tlog-feign - ${tlog.version} - - com.yomahub tlog-xxl-job @@ -321,6 +294,7 @@ local debug + false '*' @@ -330,6 +304,7 @@ dev debug + false '*' @@ -342,6 +317,7 @@ prod warn + true health, info, logfile diff --git a/ruoyi-extend/pom.xml b/ruoyi-extend/pom.xml index e44078a52..ccd525cec 100644 --- a/ruoyi-extend/pom.xml +++ b/ruoyi-extend/pom.xml @@ -5,7 +5,7 @@ ruoyi-vue-plus com.ruoyi - 3.3.0 + 3.4.0 4.0.0 ruoyi-extend diff --git a/ruoyi-extend/ruoyi-monitor-admin/pom.xml b/ruoyi-extend/ruoyi-monitor-admin/pom.xml index 33a78516d..177c9af3e 100644 --- a/ruoyi-extend/ruoyi-monitor-admin/pom.xml +++ b/ruoyi-extend/ruoyi-monitor-admin/pom.xml @@ -5,7 +5,7 @@ ruoyi-extend com.ruoyi - 3.3.0 + 3.4.0 4.0.0 jar @@ -28,6 +28,12 @@ de.codecentric spring-boot-admin-starter-server + + + de.codecentric + spring-boot-admin-starter-client + + diff --git a/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java b/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java index ca9072c78..7335e2f25 100644 --- a/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java +++ b/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java @@ -34,6 +34,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { //授予对所有静态资产和登录页面的公共访问权限。 .antMatchers(adminContextPath + "/assets/**").permitAll() .antMatchers(adminContextPath + "/login").permitAll() + .antMatchers("/actuator").anonymous() + .antMatchers("/actuator/**").anonymous() //必须对每个其他请求进行身份验证 .anyRequest().authenticated().and() //配置登录和注销 diff --git a/ruoyi-extend/ruoyi-monitor-admin/src/main/resources/application.yml b/ruoyi-extend/ruoyi-monitor-admin/src/main/resources/application.yml index 631f3e772..bf0db5620 100644 --- a/ruoyi-extend/ruoyi-monitor-admin/src/main/resources/application.yml +++ b/ruoyi-extend/ruoyi-monitor-admin/src/main/resources/application.yml @@ -1,6 +1,12 @@ server: port: 9090 +spring: + application: + name: ruoyi-monitor-admin + profiles: + active: @profiles.active@ +--- # 监控中心服务端配置 spring: security: user: @@ -9,3 +15,17 @@ spring: boot: admin: context-path: /admin + +--- # Actuator 监控端点的配置项 +management: + endpoints: + web: + # Actuator 提供的 API 接口的根目录。默认为 /actuator + base-path: /actuator + exposure: + # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。 + # 生产环境不建议放开所有 根据项目需求放开即可 + include: @endpoints.include@ + endpoint: + logfile: + external-file: ./logs/ruoyi-monitor-admin.log diff --git a/ruoyi-extend/ruoyi-xxl-job-admin/pom.xml b/ruoyi-extend/ruoyi-xxl-job-admin/pom.xml index a2b198fc9..29786ee06 100644 --- a/ruoyi-extend/ruoyi-xxl-job-admin/pom.xml +++ b/ruoyi-extend/ruoyi-xxl-job-admin/pom.xml @@ -4,7 +4,7 @@ ruoyi-extend com.ruoyi - 3.3.0 + 3.4.0 ruoyi-xxl-job-admin jar @@ -71,6 +71,11 @@ ${mysql-connector-java.version} + + de.codecentric + spring-boot-admin-starter-client + + com.xuxueli diff --git a/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application-dev.yml b/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application-dev.yml index 065b34262..540a3237a 100644 --- a/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application-dev.yml +++ b/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application-dev.yml @@ -1,3 +1,18 @@ +--- # 监控配置 +spring: + boot: + admin: + # Spring Boot Admin Client 客户端的相关配置 + client: + # 增加客户端开关 + enabled: true + # 设置 Spring Boot Admin Server 地址 + url: http://localhost:9090/admin + instance: + prefer-ip: true # 注册实例时,优先使用 IP + username: ruoyi + password: 123456 + --- # 数据库配置 spring: datasource: diff --git a/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application-prod.yml b/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application-prod.yml index 2994909ac..bcec9d82e 100644 --- a/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application-prod.yml +++ b/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application-prod.yml @@ -1,3 +1,18 @@ +--- # 监控配置 +spring: + boot: + admin: + # Spring Boot Admin Client 客户端的相关配置 + client: + # 增加客户端开关 + enabled: true + # 设置 Spring Boot Admin Server 地址 + url: http://172.30.0.90:9090/admin + instance: + prefer-ip: true # 注册实例时,优先使用 IP + username: ruoyi + password: 123456 + --- # 数据库配置 spring: datasource: diff --git a/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application.yml b/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application.yml index edafdb01b..202272087 100644 --- a/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application.yml +++ b/ruoyi-extend/ruoyi-xxl-job-admin/src/main/resources/application.yml @@ -4,6 +4,8 @@ server: servlet: context-path: /xxl-job-admin spring: + application: + name: ruoyi-xxl-job-admin profiles: active: @profiles.active@ mvc: @@ -28,13 +30,22 @@ spring: suffix: .ftl templateLoaderPath: classpath:/templates/ ---- # 监控配置 +--- # Actuator 监控端点的配置项 management: health: mail: enabled: false - server: - base-path: /actuator + endpoints: + web: + # Actuator 提供的 API 接口的根目录。默认为 /actuator + base-path: /actuator + exposure: + # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。 + # 生产环境不建议放开所有 根据项目需求放开即可 + include: @endpoints.include@ + endpoint: + logfile: + external-file: ./logs/ruoyi-xxl-job-admin.log --- # xxljob系统配置 xxl: diff --git a/ruoyi-ui/.env.development b/ruoyi-ui/.env.development index 3b003aa38..232d9077b 100644 --- a/ruoyi-ui/.env.development +++ b/ruoyi-ui/.env.development @@ -7,6 +7,9 @@ ENV = 'development' # 若依管理系统/开发环境 VUE_APP_BASE_API = '/dev-api' +# 应用访问路径 例如使用前缀 /admin/ +VUE_APP_CONTEXT_PATH = '/' + # 监控地址 VUE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/login' diff --git a/ruoyi-ui/.env.production b/ruoyi-ui/.env.production index 2d0bb6184..928000bda 100644 --- a/ruoyi-ui/.env.production +++ b/ruoyi-ui/.env.production @@ -4,6 +4,9 @@ VUE_APP_TITLE = RuoYi-Vue-Plus后台管理系统 # 生产环境配置 ENV = 'production' +# 应用访问路径 例如使用前缀 /admin/ +VUE_APP_CONTEXT_PATH = '/' + # 监控地址 VUE_APP_MONITRO_ADMIN = '/admin/login' diff --git a/ruoyi-ui/.env.staging b/ruoyi-ui/.env.staging index 49ce55c95..903abe658 100644 --- a/ruoyi-ui/.env.staging +++ b/ruoyi-ui/.env.staging @@ -6,6 +6,9 @@ NODE_ENV = production # 测试环境配置 ENV = 'staging' +# 应用访问路径 例如使用前缀 /admin/ +VUE_APP_CONTEXT_PATH = '/' + # 监控地址 VUE_APP_MONITRO_ADMIN = '/admin/login' diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 89d591b34..bad8e7723 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -37,17 +37,17 @@ }, "dependencies": { "@riophae/vue-treeselect": "0.4.0", - "axios": "0.21.0", + "axios": "0.24.0", "clipboard": "2.0.6", - "core-js": "3.8.1", + "core-js": "3.19.1", "echarts": "4.9.0", "element-ui": "2.15.6", "file-saver": "2.0.5", "fuse.js": "6.4.3", "highlight.js": "9.18.5", "js-beautify": "1.13.0", - "js-cookie": "2.2.1", - "jsencrypt": "3.0.0-rc.1", + "js-cookie": "3.0.1", + "jsencrypt": "3.2.1", "nprogress": "0.2.0", "quill": "1.3.7", "screenfull": "5.0.2", @@ -55,7 +55,7 @@ "vue": "2.6.12", "vue-count-to": "1.0.13", "vue-cropper": "0.5.5", - "vue-meta": "^2.4.0", + "vue-meta": "2.4.0", "vue-router": "3.4.9", "vuedraggable": "2.24.3", "vuex": "3.6.0" diff --git a/ruoyi-ui/src/api/login.js b/ruoyi-ui/src/api/login.js index abd49c7de..0327e6f9a 100644 --- a/ruoyi-ui/src/api/login.js +++ b/ruoyi-ui/src/api/login.js @@ -10,6 +10,9 @@ export function login(username, password, code, uuid) { } return request({ url: '/login', + headers: { + isToken: false + }, method: 'post', data: data }) @@ -47,7 +50,10 @@ export function logout() { export function getCodeImg() { return request({ url: '/captchaImage', + headers: { + isToken: false + }, method: 'get', timeout: 20000 }) -} \ No newline at end of file +} diff --git a/ruoyi-ui/src/api/monitor/job.js b/ruoyi-ui/src/api/monitor/job.js deleted file mode 100644 index 58c43434a..000000000 --- a/ruoyi-ui/src/api/monitor/job.js +++ /dev/null @@ -1,80 +0,0 @@ -import request from '@/utils/request' - -// 查询定时任务调度列表 -export function listJob(query) { - return request({ - url: '/monitor/job/list', - method: 'get', - params: query - }) -} - -// 查询定时任务调度详细 -export function getJob(jobId) { - return request({ - url: '/monitor/job/' + jobId, - method: 'get' - }) -} - -// 新增定时任务调度 -export function addJob(data) { - return request({ - url: '/monitor/job', - method: 'post', - data: data - }) -} - -// 修改定时任务调度 -export function updateJob(data) { - return request({ - url: '/monitor/job', - method: 'put', - data: data - }) -} - -// 删除定时任务调度 -export function delJob(jobId) { - return request({ - url: '/monitor/job/' + jobId, - method: 'delete' - }) -} - -// 导出定时任务调度 -export function exportJob(query) { - return request({ - url: '/monitor/job/export', - method: 'get', - params: query - }) -} - -// 任务状态修改 -export function changeJobStatus(jobId, status) { - const data = { - jobId, - status - } - return request({ - url: '/monitor/job/changeStatus', - method: 'put', - data: data - }) -} - - -// 定时任务立即执行一次 -export function runJob(jobId, jobGroup) { - const data = { - jobId, - jobGroup - } - return request({ - url: '/monitor/job/run', - method: 'put', - data: data - }) -} \ No newline at end of file diff --git a/ruoyi-ui/src/api/monitor/jobLog.js b/ruoyi-ui/src/api/monitor/jobLog.js deleted file mode 100644 index 6e0be6166..000000000 --- a/ruoyi-ui/src/api/monitor/jobLog.js +++ /dev/null @@ -1,26 +0,0 @@ -import request from '@/utils/request' - -// 查询调度日志列表 -export function listJobLog(query) { - return request({ - url: '/monitor/jobLog/list', - method: 'get', - params: query - }) -} - -// 删除调度日志 -export function delJobLog(jobLogId) { - return request({ - url: '/monitor/jobLog/' + jobLogId, - method: 'delete' - }) -} - -// 清空调度日志 -export function cleanJobLog() { - return request({ - url: '/monitor/jobLog/clean', - method: 'delete' - }) -} diff --git a/ruoyi-ui/src/api/monitor/server.js b/ruoyi-ui/src/api/monitor/server.js deleted file mode 100644 index feed7836c..000000000 --- a/ruoyi-ui/src/api/monitor/server.js +++ /dev/null @@ -1,9 +0,0 @@ -import request from '@/utils/request' - -// 查询服务器详细 -export function getServer() { - return request({ - url: '/monitor/server', - method: 'get' - }) -} \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/post.js b/ruoyi-ui/src/api/system/post.js index 434cd3513..1a8e9ca04 100644 --- a/ruoyi-ui/src/api/system/post.js +++ b/ruoyi-ui/src/api/system/post.js @@ -42,12 +42,3 @@ export function delPost(postId) { method: 'delete' }) } - -// 导出岗位 -export function exportPost(query) { - return request({ - url: '/system/post/export', - method: 'get', - params: query - }) -} \ No newline at end of file diff --git a/ruoyi-ui/src/components/Breadcrumb/index.vue b/ruoyi-ui/src/components/Breadcrumb/index.vue index 1fbae5f3c..1696f5471 100644 --- a/ruoyi-ui/src/components/Breadcrumb/index.vue +++ b/ruoyi-ui/src/components/Breadcrumb/index.vue @@ -2,7 +2,7 @@ - {{ item.meta.title }} + {{ item.meta.title }} {{ item.meta.title }} diff --git a/ruoyi-ui/src/components/RightToolbar/index.vue b/ruoyi-ui/src/components/RightToolbar/index.vue index c7ab139d7..976974e4a 100644 --- a/ruoyi-ui/src/components/RightToolbar/index.vue +++ b/ruoyi-ui/src/components/RightToolbar/index.vue @@ -62,7 +62,7 @@ export default { }, // 右侧列表元素变化 dataChange(data) { - for (var item in this.columns) { + for (let item in this.columns) { const key = this.columns[item].key; this.columns[item].visible = !data.includes(key); } diff --git a/ruoyi-ui/src/components/RuoYi/Doc/index.vue b/ruoyi-ui/src/components/RuoYi/Doc/index.vue index e267f9021..a60fd213a 100644 --- a/ruoyi-ui/src/components/RuoYi/Doc/index.vue +++ b/ruoyi-ui/src/components/RuoYi/Doc/index.vue @@ -1,6 +1,6 @@ diff --git a/ruoyi-ui/src/components/RuoYi/Git/index.vue b/ruoyi-ui/src/components/RuoYi/Git/index.vue index 4d580e418..faecbc178 100644 --- a/ruoyi-ui/src/components/RuoYi/Git/index.vue +++ b/ruoyi-ui/src/components/RuoYi/Git/index.vue @@ -1,6 +1,6 @@ diff --git a/ruoyi-ui/src/components/SizeSelect/index.vue b/ruoyi-ui/src/components/SizeSelect/index.vue index e88065b49..069b5de9b 100644 --- a/ruoyi-ui/src/components/SizeSelect/index.vue +++ b/ruoyi-ui/src/components/SizeSelect/index.vue @@ -5,8 +5,7 @@ - {{ - item.label }} + {{ item.label }} diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index e6721b70e..9de102c16 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -102,7 +102,7 @@ export default { type: 'warning' }).then(() => { this.$store.dispatch('LogOut').then(() => { - location.href = this.$router.options.base + '/index'; + location.href = process.env.VUE_APP_CONTEXT_PATH + "index"; }) }).catch(() => {}); } diff --git a/ruoyi-ui/src/layout/components/Sidebar/Logo.vue b/ruoyi-ui/src/layout/components/Sidebar/Logo.vue index 416968737..b8d9d6b7c 100644 --- a/ruoyi-ui/src/layout/components/Sidebar/Logo.vue +++ b/ruoyi-ui/src/layout/components/Sidebar/Logo.vue @@ -29,7 +29,7 @@ export default { variables() { return variables; }, - sideTheme() { + sideTheme() { return this.$store.state.settings.sideTheme } }, diff --git a/ruoyi-ui/src/layout/components/TagsView/index.vue b/ruoyi-ui/src/layout/components/TagsView/index.vue index 99bb28969..20c4b55e6 100644 --- a/ruoyi-ui/src/layout/components/TagsView/index.vue +++ b/ruoyi-ui/src/layout/components/TagsView/index.vue @@ -152,31 +152,24 @@ export default { }) }, refreshSelectedTag(view) { - this.$store.dispatch('tagsView/delCachedView', view).then(() => { - const { fullPath } = view - this.$nextTick(() => { - this.$router.replace({ - path: '/redirect' + fullPath - }) - }) - }) + this.$tab.refreshPage(view); }, closeSelectedTag(view) { - this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => { + this.$tab.closePage(view).then(({ visitedViews }) => { if (this.isActive(view)) { this.toLastView(visitedViews, view) } }) }, closeRightTags() { - this.$store.dispatch('tagsView/delRightTags', this.selectedTag).then(visitedViews => { + this.$tab.closeRightPage(this.selectedTag).then(visitedViews => { if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) { this.toLastView(visitedViews) } }) }, closeLeftTags() { - this.$store.dispatch('tagsView/delLeftTags', this.selectedTag).then(visitedViews => { + this.$tab.closeLeftPage(this.selectedTag).then(visitedViews => { if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) { this.toLastView(visitedViews) } @@ -184,12 +177,12 @@ export default { }, closeOthersTags() { this.$router.push(this.selectedTag).catch(()=>{}); - this.$store.dispatch('tagsView/delOthersViews', this.selectedTag).then(() => { + this.$tab.closeOtherPage(this.selectedTag).then(() => { this.moveToCurrentTag() }) }, closeAllTags(view) { - this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => { + this.$tab.closeAllPage().then(({ visitedViews }) => { if (this.affixTags.some(tag => tag.path === this.$route.path)) { return } diff --git a/ruoyi-ui/src/layout/index.vue b/ruoyi-ui/src/layout/index.vue index 214d86ffe..8be418409 100644 --- a/ruoyi-ui/src/layout/index.vue +++ b/ruoyi-ui/src/layout/index.vue @@ -98,7 +98,7 @@ export default { } .hideSidebar .fixed-header { - width: calc(100% - 54px) + width: calc(100% - 54px); } .mobile .fixed-header { diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index c6306a65c..29c402265 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -10,8 +10,9 @@ import '@/assets/styles/ruoyi.scss' // ruoyi css import App from './App' import store from './store' import router from './router' -import directive from './directive' //directive +import directive from './directive' // directive import plugins from './plugins' // plugins +import { download } from '@/utils/request' import './assets/icons' // icon import './permission' // permission control @@ -43,6 +44,7 @@ Vue.prototype.resetForm = resetForm Vue.prototype.addDateRange = addDateRange Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabels = selectDictLabels +Vue.prototype.download = download Vue.prototype.handleTree = handleTree // 全局组件挂载 diff --git a/ruoyi-ui/src/plugins/download.js b/ruoyi-ui/src/plugins/download.js index ec7bdd497..ac50dade2 100644 --- a/ruoyi-ui/src/plugins/download.js +++ b/ruoyi-ui/src/plugins/download.js @@ -1,51 +1,12 @@ -import { saveAs } from 'file-saver' import axios from 'axios' -import { getToken } from '@/utils/auth' import { Message } from 'element-ui' +import { saveAs } from 'file-saver' +import { getToken } from '@/utils/auth' +import { blobValidate } from "@/utils/ruoyi"; const baseURL = process.env.VUE_APP_BASE_API export default { - excel(url, params) { - // get请求映射params参数 - if (params) { - let urlparams = url + '?'; - for (const propName of Object.keys(params)) { - const value = params[propName]; - var part = encodeURIComponent(propName) + "="; - if (value !== null && typeof(value) !== "undefined") { - if (typeof value === 'object') { - for (const key of Object.keys(value)) { - if (value[key] !== null && typeof (value[key]) !== 'undefined') { - let params = propName + '[' + key + ']'; - let subPart = encodeURIComponent(params) + '='; - urlparams += subPart + encodeURIComponent(value[key]) + '&'; - } - } - } else { - urlparams += part + encodeURIComponent(value) + "&"; - } - } - } - urlparams = urlparams.slice(0, -1); - url = urlparams; - } - url = baseURL + url - axios({ - method: 'get', - url: url, - responseType: 'blob', - headers: { 'Authorization': 'Bearer ' + getToken() } - }).then(async (res) => { - const isLogin = await this.blobValidate(res.data); - if (isLogin) { - const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }) - this.saveAs(blob, decodeURI(res.headers['download-filename'])) - } else { - Message.error('无效的会话,或者会话已过期,请重新登录。'); - } - }) - }, oss(ossId) { var url = baseURL + '/system/oss/download/' + ossId axios({ @@ -54,7 +15,7 @@ export default { responseType: 'blob', headers: { 'Authorization': 'Bearer ' + getToken() } }).then(async (res) => { - const isLogin = await this.blobValidate(res.data); + const isLogin = await blobValidate(res.data); if (isLogin) { const blob = new Blob([res.data], { type: 'application/octet-stream' }) this.saveAs(blob, decodeURI(res.headers['download-filename'])) @@ -71,7 +32,7 @@ export default { responseType: 'blob', headers: { 'Authorization': 'Bearer ' + getToken() } }).then(async (res) => { - const isLogin = await this.blobValidate(res.data); + const isLogin = await blobValidate(res.data); if (isLogin) { const blob = new Blob([res.data], { type: 'application/zip' }) this.saveAs(blob, name) @@ -82,15 +43,6 @@ export default { }, saveAs(text, name, opts) { saveAs(text, name, opts); - }, - async blobValidate(data) { - try { - const text = await data.text(); - JSON.parse(text); - return false; - } catch (error) { - return true; - } - }, + } } diff --git a/ruoyi-ui/src/plugins/index.js b/ruoyi-ui/src/plugins/index.js index d1cb4dbb4..d000f2dfa 100644 --- a/ruoyi-ui/src/plugins/index.js +++ b/ruoyi-ui/src/plugins/index.js @@ -1,3 +1,4 @@ +import tab from './tab' import auth from './auth' import cache from './cache' import modal from './modal' @@ -5,6 +6,8 @@ import download from './download' export default { install(Vue) { + // 页签操作 + Vue.prototype.$tab = tab // 认证对象 Vue.prototype.$auth = auth // 缓存对象 diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index cedf0b3aa..cda6d4c3a 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -95,7 +95,7 @@ export const constantRoutes = [ path: 'role/:userId(\\d+)', component: (resolve) => require(['@/views/system/user/authRole'], resolve), name: 'AuthRole', - meta: { title: '分配角色', activeMenu: '/system/user'} + meta: { title: '分配角色', activeMenu: '/system/user' } } ] }, @@ -108,7 +108,7 @@ export const constantRoutes = [ path: 'user/:roleId(\\d+)', component: (resolve) => require(['@/views/system/role/authUser'], resolve), name: 'AuthUser', - meta: { title: '分配用户', activeMenu: '/system/role'} + meta: { title: '分配用户', activeMenu: '/system/role' } } ] }, @@ -121,7 +121,7 @@ export const constantRoutes = [ path: 'index/:dictId(\\d+)', component: (resolve) => require(['@/views/system/dict/data'], resolve), name: 'Data', - meta: { title: '字典数据', activeMenu: '/system/dict'} + meta: { title: '字典数据', activeMenu: '/system/dict' } } ] }, @@ -138,19 +138,6 @@ export const constantRoutes = [ } ] }, - { - path: '/monitor/job-log', - component: Layout, - hidden: true, - children: [ - { - path: 'index', - component: (resolve) => require(['@/views/monitor/job/log'], resolve), - name: 'JobLog', - meta: { title: '调度日志', activeMenu: '/monitor/job'} - } - ] - }, { path: '/tool/gen-edit', component: Layout, @@ -160,14 +147,13 @@ export const constantRoutes = [ path: 'index', component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), name: 'GenEdit', - meta: { title: '修改生成配置', activeMenu: '/tool/gen'} + meta: { title: '修改生成配置', activeMenu: '/tool/gen' } } ] } ] export default new Router({ - base: "", // 项目前缀 与 publicPath 同步 例如 /api mode: 'history', // 去掉url中的# scrollBehavior: () => ({ y: 0 }), routes: constantRoutes diff --git a/ruoyi-ui/src/store/modules/permission.js b/ruoyi-ui/src/store/modules/permission.js index dba9252f4..8d84fff81 100644 --- a/ruoyi-ui/src/store/modules/permission.js +++ b/ruoyi-ui/src/store/modules/permission.js @@ -1,7 +1,7 @@ import { constantRoutes } from '@/router' import { getRouters } from '@/api/menu' import Layout from '@/layout/index' -import ParentView from '@/components/ParentView'; +import ParentView from '@/components/ParentView' import InnerLink from '@/layout/components/InnerLink' const permission = { @@ -24,7 +24,7 @@ const permission = { // 顶部导航菜单默认添加统计报表栏指向首页 const index = [{ path: 'index', - meta: { title: '统计报表', icon: 'dashboard'} + meta: { title: '统计报表', icon: 'dashboard' } }] state.topbarRouters = routes.concat(index); }, diff --git a/ruoyi-ui/src/store/modules/settings.js b/ruoyi-ui/src/store/modules/settings.js index 5f36d8eee..2455a1e27 100644 --- a/ruoyi-ui/src/store/modules/settings.js +++ b/ruoyi-ui/src/store/modules/settings.js @@ -8,7 +8,7 @@ const state = { theme: storageSetting.theme || '#409EFF', sideTheme: storageSetting.sideTheme || sideTheme, showSettings: showSettings, - topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav, + topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav, tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView, fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader, sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo, diff --git a/ruoyi-ui/src/store/modules/tagsView.js b/ruoyi-ui/src/store/modules/tagsView.js index ef2fe4caf..002c1d099 100644 --- a/ruoyi-ui/src/store/modules/tagsView.js +++ b/ruoyi-ui/src/store/modules/tagsView.js @@ -14,7 +14,7 @@ const mutations = { }, ADD_CACHED_VIEW: (state, view) => { if (state.cachedViews.includes(view.name)) return - if (!view.meta.noCache) { + if (view.meta && !view.meta.noCache) { state.cachedViews.push(view.name) } }, @@ -63,7 +63,7 @@ const mutations = { } } }, - + DEL_RIGHT_VIEWS: (state, view) => { const index = state.visitedViews.findIndex(v => v.path === view.path) if (index === -1) { diff --git a/ruoyi-ui/src/utils/dict/index.js b/ruoyi-ui/src/utils/dict/index.js index 849330266..215eb9e05 100644 --- a/ruoyi-ui/src/utils/dict/index.js +++ b/ruoyi-ui/src/utils/dict/index.js @@ -5,7 +5,7 @@ export default function(Vue, options) { mergeOptions(options) Vue.mixin({ data() { - if (this.$options.dicts === undefined || this.$options.dicts === null) { + if (this.$options === undefined || this.$options.dicts === undefined || this.$options.dicts === null) { return {} } const dict = new Dict() diff --git a/ruoyi-ui/src/utils/index.js b/ruoyi-ui/src/utils/index.js index 918580f7b..df5db12b0 100644 --- a/ruoyi-ui/src/utils/index.js +++ b/ruoyi-ui/src/utils/index.js @@ -5,12 +5,12 @@ import { parseTime } from './ruoyi' */ export function formatDate(cellValue) { if (cellValue == null || cellValue == "") return ""; - var date = new Date(cellValue) + var date = new Date(cellValue) var year = date.getFullYear() var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 - var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() - var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() - var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() + var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() + var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() + var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds } @@ -330,7 +330,7 @@ export function makeMap(str, expectsLowerCase) { ? val => map[val.toLowerCase()] : val => map[val] } - + export const exportDefault = 'export default ' export const beautifierConf = { @@ -381,10 +381,10 @@ export function titleCase(str) { // 下划转驼峰 export function camelCase(str) { - return str.replace(/-[a-z]/g, str1 => str1.substr(-1).toUpperCase()) + return str.replace(/_[a-z]/g, str1 => str1.substr(-1).toUpperCase()) } export function isNumberStr(str) { return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) } - + diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index e8b3b5f16..d376a76a5 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -1,8 +1,12 @@ import axios from 'axios' -import { Notification, MessageBox, Message } from 'element-ui' +import { Notification, MessageBox, Message, Loading } from 'element-ui' import store from '@/store' import { getToken } from '@/utils/auth' import errorCode from '@/utils/errorCode' +import { tansParams, blobValidate } from "@/utils/ruoyi"; +import { saveAs } from 'file-saver' + +let downloadLoadingInstance; axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' // 对应国际化资源文件后缀 @@ -14,6 +18,7 @@ const service = axios.create({ // 超时 timeout: 10000 }) + // request拦截器 service.interceptors.request.use(config => { // 是否需要设置 token @@ -23,24 +28,7 @@ service.interceptors.request.use(config => { } // get请求映射params参数 if (config.method === 'get' && config.params) { - let url = config.url + '?'; - for (const propName of Object.keys(config.params)) { - const value = config.params[propName]; - var part = encodeURIComponent(propName) + "="; - if (value !== null && typeof(value) !== "undefined") { - if (typeof value === 'object') { - for (const key of Object.keys(value)) { - if (value[key] !== null && typeof (value[key]) !== 'undefined') { - let params = propName + '[' + key + ']'; - let subPart = encodeURIComponent(params) + '='; - url += subPart + encodeURIComponent(value[key]) + '&'; - } - } - } else { - url += part + encodeURIComponent(value) + "&"; - } - } - } + let url = config.url + '?' + tansParams(config.params); url = url.slice(0, -1); config.params = {}; config.url = url; @@ -57,6 +45,10 @@ service.interceptors.response.use(res => { const code = res.data.code || 200; // 获取错误信息 const msg = errorCode[code] || res.data.msg || errorCode['default'] + // 二进制数据则直接返回 + if(res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer'){ + return res.data + } if (code === 401) { MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', @@ -65,7 +57,7 @@ service.interceptors.response.use(res => { } ).then(() => { store.dispatch('LogOut').then(() => { - location.href = this.$router.options.base + '/index'; + location.href = process.env.VUE_APP_CONTEXT_PATH + "index"; }) }).catch(() => {}); return Promise.reject('无效的会话,或者会话已过期,请重新登录。') @@ -105,4 +97,27 @@ service.interceptors.response.use(res => { } ) +// 通用下载方法 +export function download(url, params, filename) { + downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) + return service.post(url, params, { + transformRequest: [(params) => { return tansParams(params) }], + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: 'blob' + }).then(async (data) => { + const isLogin = await blobValidate(data); + if (isLogin) { + const blob = new Blob([data]) + saveAs(blob, filename) + } else { + Message.error('无效的会话,或者会话已过期,请重新登录。'); + } + downloadLoadingInstance.close(); + }).catch((r) => { + console.error(r) + Message.error('下载文件出现错误,请联系管理员!') + downloadLoadingInstance.close(); + }) +} + export default service diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js index 63bd379b7..4cc5e24ea 100644 --- a/ruoyi-ui/src/utils/ruoyi.js +++ b/ruoyi-ui/src/utils/ruoyi.js @@ -85,8 +85,8 @@ export function selectDictLabels(datas, value, separator) { var temp = value.split(currentSeparator); Object.keys(value.split(currentSeparator)).some((val) => { Object.keys(datas).some((key) => { - if (datas[key].dictValue == ('' + temp[val])) { - actions.push(datas[key].dictLabel + currentSeparator); + if (datas[key].value == ('' + temp[val])) { + actions.push(datas[key].label + currentSeparator); } }) }) @@ -181,3 +181,40 @@ export function handleTree(data, id, parentId, children) { } return tree; } + +/** +* 参数处理 +* @param {*} params 参数 +*/ +export function tansParams(params) { + let result = '' + for (const propName of Object.keys(params)) { + const value = params[propName]; + var part = encodeURIComponent(propName) + "="; + if (value !== null && typeof (value) !== "undefined") { + if (typeof value === 'object') { + for (const key of Object.keys(value)) { + if (value[key] !== null && typeof (value[key]) !== 'undefined') { + let params = propName + '[' + key + ']'; + var subPart = encodeURIComponent(params) + "="; + result += subPart + encodeURIComponent(value[key]) + "&"; + } + } + } else { + result += part + encodeURIComponent(value) + "&"; + } + } + } + return result +} + +// 验证是否为blob格式 +export async function blobValidate(data) { + try { + const text = await data.text(); + JSON.parse(text); + return false; + } catch (error) { + return true; + } +} diff --git a/ruoyi-ui/src/views/demo/demo/index.vue b/ruoyi-ui/src/views/demo/demo/index.vue index 678ae218a..65387c9a5 100644 --- a/ruoyi-ui/src/views/demo/demo/index.vue +++ b/ruoyi-ui/src/views/demo/demo/index.vue @@ -71,13 +71,22 @@ v-hasPermi="['demo:demo:remove']" >删除 + + 导入(校验) + 导出 @@ -165,11 +174,34 @@ 取 消 + + + + +
将文件拖到此处,或点击上传
+
+ +
diff --git a/ruoyi-ui/src/views/monitor/job/log.vue b/ruoyi-ui/src/views/monitor/job/log.vue deleted file mode 100644 index fca1af40e..000000000 --- a/ruoyi-ui/src/views/monitor/job/log.vue +++ /dev/null @@ -1,300 +0,0 @@ - - - diff --git a/ruoyi-ui/src/views/monitor/logininfor/index.vue b/ruoyi-ui/src/views/monitor/logininfor/index.vue index 5b113016d..98bd74357 100644 --- a/ruoyi-ui/src/views/monitor/logininfor/index.vue +++ b/ruoyi-ui/src/views/monitor/logininfor/index.vue @@ -6,8 +6,8 @@ v-model="queryParams.ipaddr" placeholder="请输入登录地址" clearable + size="small" style="width: 240px;" - size="small" @keyup.enter.native="handleQuery" /> @@ -16,8 +16,8 @@ v-model="queryParams.userName" placeholder="请输入用户名称" clearable + size="small" style="width: 240px;" - size="small" @keyup.enter.native="handleQuery" /> @@ -83,7 +83,6 @@ plain icon="el-icon-download" size="mini" - :loading="exportLoading" @click="handleExport" v-hasPermi="['monitor:logininfor:export']" >导出 @@ -132,8 +131,6 @@ export default { return { // 遮罩层 loading: true, - // 导出遮罩层 - exportLoading: false, // 选中数组 ids: [], // 非多个禁用 @@ -216,7 +213,9 @@ export default { }, /** 导出按钮操作 */ handleExport() { - this.$download.excel('/monitor/logininfor/export', this.queryParams); + this.download('monitor/logininfor/export', { + ...this.queryParams + }, `logininfor_${new Date().getTime()}.xlsx`) } } }; diff --git a/ruoyi-ui/src/views/monitor/operlog/index.vue b/ruoyi-ui/src/views/monitor/operlog/index.vue index 35fd2b812..9b8b7856b 100644 --- a/ruoyi-ui/src/views/monitor/operlog/index.vue +++ b/ruoyi-ui/src/views/monitor/operlog/index.vue @@ -6,8 +6,8 @@ v-model="queryParams.title" placeholder="请输入系统模块" clearable - style="width: 240px;" size="small" + style="width: 240px;" @keyup.enter.native="handleQuery" /> @@ -16,8 +16,8 @@ v-model="queryParams.operName" placeholder="请输入操作人员" clearable - style="width: 240px;" size="small" + style="width: 240px;" @keyup.enter.native="handleQuery" /> @@ -99,7 +99,6 @@ plain icon="el-icon-download" size="mini" - :loading="exportLoading" @click="handleExport" v-hasPermi="['monitor:operlog:export']" >导出 @@ -205,8 +204,6 @@ export default { return { // 遮罩层 loading: true, - // 导出遮罩层 - exportLoading: false, // 选中数组 ids: [], // 非多个禁用 @@ -303,7 +300,9 @@ export default { }, /** 导出按钮操作 */ handleExport() { - this.$download.excel('/monitor/operlog/export', this.queryParams); + this.download('monitor/operlog/export', { + ...this.queryParams + }, `operlog_${new Date().getTime()}.xlsx`) } } }; diff --git a/ruoyi-ui/src/views/register.vue b/ruoyi-ui/src/views/register.vue index 393f100d3..759931492 100644 --- a/ruoyi-ui/src/views/register.vue +++ b/ruoyi-ui/src/views/register.vue @@ -127,7 +127,8 @@ export default { register(this.registerForm).then(res => { const username = this.registerForm.username; this.$alert("恭喜你,您的账号 " + username + " 注册成功!", '系统提示', { - dangerouslyUseHTMLString: true + dangerouslyUseHTMLString: true, + type: 'success' }).then(() => { this.$router.push("/login"); }).catch(() => {}); diff --git a/ruoyi-ui/src/views/system/config/index.vue b/ruoyi-ui/src/views/system/config/index.vue index b03791755..9fde370f7 100644 --- a/ruoyi-ui/src/views/system/config/index.vue +++ b/ruoyi-ui/src/views/system/config/index.vue @@ -88,7 +88,6 @@ plain icon="el-icon-download" size="mini" - :loading="exportLoading" @click="handleExport" v-hasPermi="['system:config:export']" >导出 @@ -194,8 +193,6 @@ export default { return { // 遮罩层 loading: true, - // 导出遮罩层 - exportLoading: false, // 选中数组 ids: [], // 非单个禁用 @@ -334,7 +331,9 @@ export default { }, /** 导出按钮操作 */ handleExport() { - this.$download.excel('/system/config/export', this.queryParams); + this.download('system/config/export', { + ...this.queryParams + }, `config_${new Date().getTime()}.xlsx`) }, /** 刷新缓存按钮操作 */ handleRefreshCache() { diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue index f9c7741e5..e215b1c8e 100644 --- a/ruoyi-ui/src/views/system/dept/index.vue +++ b/ruoyi-ui/src/views/system/dept/index.vue @@ -179,8 +179,6 @@ export default { isExpandAll: true, // 重新渲染表格状态 refreshTable: true, - // 是否展开 - expand: false, // 查询参数 queryParams: { deptName: undefined, @@ -276,7 +274,7 @@ export default { this.open = true; this.title = "添加部门"; listDept().then(response => { - this.deptOptions = this.handleTree(response.data, "deptId"); + this.deptOptions = this.handleTree(response.data, "deptId"); }); }, /** 展开/折叠操作 */ @@ -296,7 +294,7 @@ export default { this.title = "修改部门"; }); listDeptExcludeChild(row.deptId).then(response => { - this.deptOptions = this.handleTree(response.data, "deptId"); + this.deptOptions = this.handleTree(response.data, "deptId"); }); }, /** 提交按钮 */ diff --git a/ruoyi-ui/src/views/system/dict/data.vue b/ruoyi-ui/src/views/system/dict/data.vue index c7a90067e..bf538ad90 100644 --- a/ruoyi-ui/src/views/system/dict/data.vue +++ b/ruoyi-ui/src/views/system/dict/data.vue @@ -75,11 +75,19 @@ plain icon="el-icon-download" size="mini" - :loading="exportLoading" @click="handleExport" v-hasPermi="['system:dict:export']" >导出
+ + 关闭 + @@ -193,8 +201,6 @@ export default { return { // 遮罩层 loading: true, - // 导出遮罩层 - exportLoading: false, // 选中数组 ids: [], // 非单个禁用 @@ -319,6 +325,11 @@ export default { this.queryParams.pageNum = 1; this.getList(); }, + /** 返回按钮操作 */ + handleClose() { + const obj = { path: "/system/dict" }; + this.$tab.closeOpenPage(obj); + }, /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); @@ -380,8 +391,10 @@ export default { }, /** 导出按钮操作 */ handleExport() { - this.$download.excel('/system/dict/data/export', this.queryParams); + this.download('system/dict/data/export', { + ...this.queryParams + }, `data_${new Date().getTime()}.xlsx`) } } }; - \ No newline at end of file + diff --git a/ruoyi-ui/src/views/system/dict/index.vue b/ruoyi-ui/src/views/system/dict/index.vue index 6daa8679c..92b78c98b 100644 --- a/ruoyi-ui/src/views/system/dict/index.vue +++ b/ruoyi-ui/src/views/system/dict/index.vue @@ -94,7 +94,6 @@ plain icon="el-icon-download" size="mini" - :loading="exportLoading" @click="handleExport" v-hasPermi="['system:dict:export']" >导出 @@ -202,8 +201,6 @@ export default { return { // 遮罩层 loading: true, - // 导出遮罩层 - exportLoading: false, // 选中数组 ids: [], // 非单个禁用 @@ -338,7 +335,9 @@ export default { }, /** 导出按钮操作 */ handleExport() { - this.$download.excel('/system/dict/type/export', this.queryParams); + this.download('system/dict/type/export', { + ...this.queryParams + }, `type_${new Date().getTime()}.xlsx`) }, /** 刷新缓存按钮操作 */ handleRefreshCache() { @@ -348,4 +347,4 @@ export default { } } }; - \ No newline at end of file + diff --git a/ruoyi-ui/src/views/system/menu/index.vue b/ruoyi-ui/src/views/system/menu/index.vue index a89e1ee71..d65773ad2 100644 --- a/ruoyi-ui/src/views/system/menu/index.vue +++ b/ruoyi-ui/src/views/system/menu/index.vue @@ -78,7 +78,8 @@ - + @@ -109,9 +109,9 @@ export default { }, /** 关闭按钮 */ close() { - this.$store.dispatch("tagsView/delView", this.$route); - this.$router.push({ path: "/system/user" }); + const obj = { path: "/system/user" }; + this.$tab.closeOpenPage(obj); }, }, }; - \ No newline at end of file + diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index 4faa25020..1ff9b906b 100644 --- a/ruoyi-ui/src/views/system/user/index.vue +++ b/ruoyi-ui/src/views/system/user/index.vue @@ -131,7 +131,6 @@ plain icon="el-icon-download" size="mini" - :loading="exportLoading" @click="handleExport" v-hasPermi="['system:user:export']" >导出 @@ -207,7 +206,7 @@ - + @@ -360,8 +359,6 @@ export default { return { // 遮罩层 loading: true, - // 导出遮罩层 - exportLoading: false, // 选中数组 ids: [], // 非单个禁用 @@ -643,7 +640,9 @@ export default { }, /** 导出按钮操作 */ handleExport() { - this.$download.excel('/system/user/export', this.queryParams); + this.download('system/user/export', { + ...this.queryParams + }, `user_${new Date().getTime()}.xlsx`) }, /** 导入按钮操作 */ handleImport() { @@ -652,7 +651,8 @@ export default { }, /** 下载模板操作 */ importTemplate() { - this.$download.excel('/system/user/importTemplate'); + this.download('system/user/importTemplate', { + }, `user_template_${new Date().getTime()}.xlsx`) }, // 文件上传中处理 handleFileUploadProgress(event, file, fileList) { @@ -672,4 +672,4 @@ export default { } } }; - \ No newline at end of file + diff --git a/ruoyi-ui/src/views/system/user/profile/resetPwd.vue b/ruoyi-ui/src/views/system/user/profile/resetPwd.vue index 119f1036f..0a8d216b1 100644 --- a/ruoyi-ui/src/views/system/user/profile/resetPwd.vue +++ b/ruoyi-ui/src/views/system/user/profile/resetPwd.vue @@ -29,7 +29,6 @@ export default { } }; return { - test: "1test", user: { oldPassword: undefined, newPassword: undefined, @@ -55,17 +54,14 @@ export default { submit() { this.$refs["form"].validate(valid => { if (valid) { - updateUserPwd(this.user.oldPassword, this.user.newPassword).then( - response => { - this.$modal.msgSuccess("修改成功"); - } - ); + updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => { + this.$modal.msgSuccess("修改成功"); + }); } }); }, close() { - this.$store.dispatch("tagsView/delView", this.$route); - this.$router.push({ path: "/index" }); + this.$tab.closePage(); } } }; diff --git a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue index 08652c2f7..d094602a2 100644 --- a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue +++ b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue @@ -1,7 +1,7 @@