diff --git a/docker/deploy.sh b/docker/deploy.sh new file mode 100644 index 00000000..0ee4cd8a --- /dev/null +++ b/docker/deploy.sh @@ -0,0 +1,67 @@ +#!/bin/sh + +# 使用说明,用来提示输入参数 +usage() { + echo "Usage: sh 执行脚本.sh [port|base|modules|stop|rm]" + exit 1 +} + +# 开启所需端口 +port(){ + firewall-cmd --add-port=80/tcp --permanent + firewall-cmd --add-port=8080/tcp --permanent + firewall-cmd --add-port=8848/tcp --permanent + firewall-cmd --add-port=9848/tcp --permanent + firewall-cmd --add-port=9849/tcp --permanent + firewall-cmd --add-port=6379/tcp --permanent + firewall-cmd --add-port=3306/tcp --permanent + firewall-cmd --add-port=9100/tcp --permanent + firewall-cmd --add-port=9200/tcp --permanent + firewall-cmd --add-port=9201/tcp --permanent + firewall-cmd --add-port=9202/tcp --permanent + firewall-cmd --add-port=9203/tcp --permanent + firewall-cmd --add-port=9300/tcp --permanent + service firewalld restart +} + +# 启动基础环境(必须) +base(){ + docker-compose up -d ruoyi-mysql ruoyi-redis ruoyi-nacos ruoyi-nginx +} + +# 启动程序模块(必须) +modules(){ + docker-compose up -d ruoyi-gateway ruoyi-auth ruoyi-modules-system +} + +# 关闭所有环境/模块 +stop(){ + docker-compose stop +} + +# 删除所有环境/模块 +rm(){ + docker-compose rm +} + +# 根据输入参数,选择执行对应方法,不输入则执行使用说明 +case "$1" in +"port") + port +;; +"base") + base +;; +"modules") + modules +;; +"stop") + stop +;; +"rm") + rm +;; +*) + usage +;; +esac diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..5fb8da1c --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,140 @@ +version : '3.8' +services: + ruoyi-nacos: + container_name: ruoyi-nacos + image: nacos/nacos-server + build: + context: ./nacos + environment: + - MODE=standalone + volumes: + - ./nacos/logs/:/home/nacos/logs + - ./nacos/conf/application.properties:/home/nacos/conf/application.properties + ports: + - "8848:8848" + - "9848:9848" + - "9849:9849" + depends_on: + - ruoyi-mysql + ruoyi-mysql: + container_name: ruoyi-mysql + image: mysql:5.7 + build: + context: ./mysql + ports: + - "3306:3306" + volumes: + - ./mysql/conf:/etc/mysql/conf.d + - ./mysql/logs:/logs + - ./mysql/data:/var/lib/mysql + command: [ + 'mysqld', + '--innodb-buffer-pool-size=80M', + '--character-set-server=utf8mb4', + '--collation-server=utf8mb4_unicode_ci', + '--default-time-zone=+8:00', + '--lower-case-table-names=1' + ] + environment: + MYSQL_DATABASE: 'ry-cloud' + MYSQL_ROOT_PASSWORD: password + ruoyi-redis: + container_name: ruoyi-redis + image: redis + build: + context: ./redis + ports: + - "6379:6379" + volumes: + - ./redis/conf/redis.conf:/home/ruoyi/redis/redis.conf + - ./redis/data:/data + command: redis-server /home/ruoyi/redis/redis.conf + ruoyi-nginx: + container_name: ruoyi-nginx + image: nginx + build: + context: ./nginx + ports: + - "80:80" + volumes: + - ./nginx/html/dist:/home/ruoyi/projects/ruoyi-ui + - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf + - ./nginx/logs:/var/log/nginx + - ./nginx/conf.d:/etc/nginx/conf.d + depends_on: + - ruoyi-gateway + links: + - ruoyi-gateway + ruoyi-gateway: + container_name: ruoyi-gateway + build: + context: ./ruoyi/gateway + dockerfile: dockerfile + ports: + - "8080:8080" + depends_on: + - ruoyi-redis + links: + - ruoyi-redis + ruoyi-auth: + container_name: ruoyi-auth + build: + context: ./ruoyi/auth + dockerfile: dockerfile + ports: + - "9200:9200" + depends_on: + - ruoyi-redis + links: + - ruoyi-redis + ruoyi-modules-system: + container_name: ruoyi-modules-system + build: + context: ./ruoyi/modules/system + dockerfile: dockerfile + ports: + - "9201:9201" + depends_on: + - ruoyi-redis + - ruoyi-mysql + links: + - ruoyi-redis + - ruoyi-mysql + ruoyi-modules-gen: + container_name: ruoyi-modules-gen + build: + context: ./ruoyi/modules/gen + dockerfile: dockerfile + ports: + - "9202:9202" + depends_on: + - ruoyi-mysql + links: + - ruoyi-mysql + ruoyi-modules-job: + container_name: ruoyi-modules-job + build: + context: ./ruoyi/modules/job + dockerfile: dockerfile + ports: + - "9203:9203" + depends_on: + - ruoyi-mysql + links: + - ruoyi-mysql + ruoyi-modules-file: + container_name: ruoyi-modules-file + build: + context: ./ruoyi/modules/file + dockerfile: dockerfile + ports: + - "9300:9300" + volumes: + - ./ruoyi/uploadPath:/home/ruoyi/uploadPath + ruoyi-visual-monitor: + container_name: ruoyi-visual-monitor + build: + context: ./ruoyi/visual/monitor + dockerfile: dockerfile + ports: + - "9100:9100" diff --git a/docker/mysql/db/readme.txt b/docker/mysql/db/readme.txt new file mode 100644 index 00000000..0b22f3fe --- /dev/null +++ b/docker/mysql/db/readme.txt @@ -0,0 +1 @@ +sqlĿ¼µнűdockerԶִС \ No newline at end of file diff --git a/docker/mysql/dockerfile b/docker/mysql/dockerfile new file mode 100644 index 00000000..b35dc5fd --- /dev/null +++ b/docker/mysql/dockerfile @@ -0,0 +1,7 @@ +# 基础镜像 +FROM mysql:5.7 +# author +MAINTAINER ruoyi + +# 执行sql脚本 +ADD ./db/*.sql /docker-entrypoint-initdb.d/ diff --git a/docker/nacos/conf/application.properties b/docker/nacos/conf/application.properties new file mode 100644 index 00000000..e0034a9c --- /dev/null +++ b/docker/nacos/conf/application.properties @@ -0,0 +1,32 @@ +spring.datasource.platform=mysql +db.num=1 +db.url.0=jdbc:mysql://ruoyi-mysql:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC +db.user=root +db.password=password + +nacos.naming.empty-service.auto-clean=true +nacos.naming.empty-service.clean.initial-delay-ms=50000 +nacos.naming.empty-service.clean.period-time-ms=30000 + +management.endpoints.web.exposure.include=* + +management.metrics.export.elastic.enabled=false +management.metrics.export.influx.enabled=false + +server.tomcat.accesslog.enabled=true +server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i + +server.tomcat.basedir= + +nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/** + +nacos.core.auth.system.type=nacos +nacos.core.auth.enabled=false +nacos.core.auth.default.token.expire.seconds=18000 +nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789 +nacos.core.auth.caching.enabled=true +nacos.core.auth.enable.userAgentAuthWhite=false +nacos.core.auth.server.identity.key=serverIdentity +nacos.core.auth.server.identity.value=security + +nacos.istio.mcp.server.enabled=false diff --git a/docker/nacos/dockerfile b/docker/nacos/dockerfile new file mode 100644 index 00000000..a9f72d99 --- /dev/null +++ b/docker/nacos/dockerfile @@ -0,0 +1,7 @@ +# 基础镜像 +FROM nacos/nacos-server +# author +MAINTAINER ruoyi + +# 复制conf文件到路径 +COPY ./conf/application.properties /home/nacos/conf/application.properties diff --git a/docker/nginx/conf/nginx.conf b/docker/nginx/conf/nginx.conf new file mode 100644 index 00000000..56bf0ca2 --- /dev/null +++ b/docker/nginx/conf/nginx.conf @@ -0,0 +1,36 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + + server { + listen 80; + server_name localhost; + + location / { + root /home/ruoyi/projects/ruoyi-ui; + try_files $uri $uri/ /index.html; + index index.html index.htm; + } + + location /prod-api/{ + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://ruoyi-gateway:8080/; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } +}# requirepass 123456 \ No newline at end of file diff --git a/docker/nginx/dockerfile b/docker/nginx/dockerfile new file mode 100644 index 00000000..e0025b1b --- /dev/null +++ b/docker/nginx/dockerfile @@ -0,0 +1,15 @@ +# 基础镜像 +FROM nginx +# author +MAINTAINER ruoyi + +# 挂载目录 +VOLUME /home/ruoyi/projects/ruoyi-ui +# 创建目录 +RUN mkdir -p /home/ruoyi/projects/ruoyi-ui +# 指定路径 +WORKDIR /home/ruoyi/projects/ruoyi-ui +# 复制conf文件到路径 +COPY ./conf/nginx.conf /etc/nginx/nginx.conf +# 复制html文件到路径 +COPY ./html/dist /home/ruoyi/projects/ruoyi-ui diff --git a/docker/nginx/html/dist/readme.txt b/docker/nginx/html/dist/readme.txt new file mode 100644 index 00000000..eea3a328 --- /dev/null +++ b/docker/nginx/html/dist/readme.txt @@ -0,0 +1 @@ +ǰruoyi-uiõľ̬ļnginxʡ \ No newline at end of file diff --git a/docker/redis/conf/redis.conf b/docker/redis/conf/redis.conf new file mode 100644 index 00000000..d762d650 --- /dev/null +++ b/docker/redis/conf/redis.conf @@ -0,0 +1 @@ +# requirepass 123456 \ No newline at end of file diff --git a/docker/redis/dockerfile b/docker/redis/dockerfile new file mode 100644 index 00000000..dd7eaa80 --- /dev/null +++ b/docker/redis/dockerfile @@ -0,0 +1,13 @@ +# 基础镜像 +FROM redis +# author +MAINTAINER ruoyi + +# 挂载目录 +VOLUME /home/ruoyi/redis +# 创建目录 +RUN mkdir -p /home/ruoyi/redis +# 指定路径 +WORKDIR /home/ruoyi/redis +# 复制conf文件到路径 +COPY ./conf/redis.conf /home/ruoyi/redis/redis.conf diff --git a/docker/ruoyi/auth/dockerfile b/docker/ruoyi/auth/dockerfile new file mode 100644 index 00000000..01e777f0 --- /dev/null +++ b/docker/ruoyi/auth/dockerfile @@ -0,0 +1,15 @@ +# 基础镜像 +FROM openjdk:8-jre +# author +MAINTAINER ruoyi + +# 挂载目录 +VOLUME /home/ruoyi +# 创建目录 +RUN mkdir -p /home/ruoyi +# 指定路径 +WORKDIR /home/ruoyi +# 复制jar文件到路径 +COPY ./jar/ruoyi-auth.jar /home/ruoyi/ruoyi-auth.jar +# 启动认证服务 +ENTRYPOINT ["java","-jar","ruoyi-auth.jar"] \ No newline at end of file diff --git a/docker/ruoyi/auth/jar/readme.txt b/docker/ruoyi/auth/jar/readme.txt new file mode 100644 index 00000000..c35ba276 --- /dev/null +++ b/docker/ruoyi/auth/jar/readme.txt @@ -0,0 +1 @@ +֤ĴõjarļdockerӦá \ No newline at end of file diff --git a/docker/ruoyi/gateway/dockerfile b/docker/ruoyi/gateway/dockerfile new file mode 100644 index 00000000..016fdce7 --- /dev/null +++ b/docker/ruoyi/gateway/dockerfile @@ -0,0 +1,15 @@ +# 基础镜像 +FROM openjdk:8-jre +# author +MAINTAINER ruoyi + +# 挂载目录 +VOLUME /home/ruoyi +# 创建目录 +RUN mkdir -p /home/ruoyi +# 指定路径 +WORKDIR /home/ruoyi +# 复制jar文件到路径 +COPY ./jar/ruoyi-gateway.jar /home/ruoyi/ruoyi-gateway.jar +# 启动网关服务 +ENTRYPOINT ["java","-jar","ruoyi-gateway.jar"] \ No newline at end of file diff --git a/docker/ruoyi/gateway/jar/readme.txt b/docker/ruoyi/gateway/jar/readme.txt new file mode 100644 index 00000000..5dfbec76 --- /dev/null +++ b/docker/ruoyi/gateway/jar/readme.txt @@ -0,0 +1 @@ +ģõjarļdockerӦá \ No newline at end of file diff --git a/docker/ruoyi/modules/file/dockerfile b/docker/ruoyi/modules/file/dockerfile new file mode 100644 index 00000000..7178d134 --- /dev/null +++ b/docker/ruoyi/modules/file/dockerfile @@ -0,0 +1,15 @@ +# 基础镜像 +FROM openjdk:8-jre +# author +MAINTAINER ruoyi + +# 挂载目录 +VOLUME /home/ruoyi +# 创建目录 +RUN mkdir -p /home/ruoyi +# 指定路径 +WORKDIR /home/ruoyi +# 复制jar文件到路径 +COPY ./jar/ruoyi-modules-file.jar /home/ruoyi/ruoyi-modules-file.jar +# 启动文件服务 +ENTRYPOINT ["java","-jar","ruoyi-modules-file.jar"] \ No newline at end of file diff --git a/docker/ruoyi/modules/file/jar/readme.txt b/docker/ruoyi/modules/file/jar/readme.txt new file mode 100644 index 00000000..bf2b2a7f --- /dev/null +++ b/docker/ruoyi/modules/file/jar/readme.txt @@ -0,0 +1 @@ +ļõjarļdockerӦá \ No newline at end of file diff --git a/docker/ruoyi/modules/gen/dockerfile b/docker/ruoyi/modules/gen/dockerfile new file mode 100644 index 00000000..def260d3 --- /dev/null +++ b/docker/ruoyi/modules/gen/dockerfile @@ -0,0 +1,15 @@ +# 基础镜像 +FROM openjdk:8-jre +# author +MAINTAINER ruoyi + +# 挂载目录 +VOLUME /home/ruoyi +# 创建目录 +RUN mkdir -p /home/ruoyi +# 指定路径 +WORKDIR /home/ruoyi +# 复制jar文件到路径 +COPY ./jar/ruoyi-modules-gen.jar /home/ruoyi/ruoyi-modules-gen.jar +# 启动代码生成服务 +ENTRYPOINT ["java","-jar","ruoyi-modules-gen.jar"] \ No newline at end of file diff --git a/docker/ruoyi/modules/gen/jar/readme.txt b/docker/ruoyi/modules/gen/jar/readme.txt new file mode 100644 index 00000000..2f25c0af --- /dev/null +++ b/docker/ruoyi/modules/gen/jar/readme.txt @@ -0,0 +1 @@ +ŴɴõjarļdockerӦá \ No newline at end of file diff --git a/docker/ruoyi/modules/job/dockerfile b/docker/ruoyi/modules/job/dockerfile new file mode 100644 index 00000000..100ecae2 --- /dev/null +++ b/docker/ruoyi/modules/job/dockerfile @@ -0,0 +1,15 @@ +# 基础镜像 +FROM openjdk:8-jre +# author +MAINTAINER ruoyi + +# 挂载目录 +VOLUME /home/ruoyi +# 创建目录 +RUN mkdir -p /home/ruoyi +# 指定路径 +WORKDIR /home/ruoyi +# 复制jar文件到路径 +COPY ./jar/ruoyi-modules-job.jar /home/ruoyi/ruoyi-modules-job.jar +# 启动定时任务服务 +ENTRYPOINT ["java","-jar","ruoyi-modules-job.jar"] \ No newline at end of file diff --git a/docker/ruoyi/modules/job/jar/readme.txt b/docker/ruoyi/modules/job/jar/readme.txt new file mode 100644 index 00000000..58aea0b1 --- /dev/null +++ b/docker/ruoyi/modules/job/jar/readme.txt @@ -0,0 +1 @@ +ŶʱõjarļdockerӦá \ No newline at end of file diff --git a/docker/ruoyi/modules/system/dockerfile b/docker/ruoyi/modules/system/dockerfile new file mode 100644 index 00000000..ced23b2e --- /dev/null +++ b/docker/ruoyi/modules/system/dockerfile @@ -0,0 +1,15 @@ +# 基础镜像 +FROM openjdk:8-jre +# author +MAINTAINER ruoyi + +# 挂载目录 +VOLUME /home/ruoyi +# 创建目录 +RUN mkdir -p /home/ruoyi +# 指定路径 +WORKDIR /home/ruoyi +# 复制jar文件到路径 +COPY ./jar/ruoyi-modules-system.jar /home/ruoyi/ruoyi-modules-system.jar +# 启动系统服务 +ENTRYPOINT ["java","-jar","ruoyi-modules-system.jar"] \ No newline at end of file diff --git a/docker/ruoyi/modules/system/jar/readme.txt b/docker/ruoyi/modules/system/jar/readme.txt new file mode 100644 index 00000000..cfc2a927 --- /dev/null +++ b/docker/ruoyi/modules/system/jar/readme.txt @@ -0,0 +1 @@ +ϵͳģõjarļdockerӦá \ No newline at end of file diff --git a/docker/ruoyi/visual/monitor/dockerfile b/docker/ruoyi/visual/monitor/dockerfile new file mode 100644 index 00000000..ea9370a3 --- /dev/null +++ b/docker/ruoyi/visual/monitor/dockerfile @@ -0,0 +1,15 @@ +# 基础镜像 +FROM openjdk:8-jre +# author +MAINTAINER ruoyi + +# 挂载目录 +VOLUME /home/ruoyi +# 创建目录 +RUN mkdir -p /home/ruoyi +# 指定路径 +WORKDIR /home/ruoyi +# 复制jar文件到路径 +COPY ./jar/ruoyi-visual-monitor.jar /home/ruoyi/ruoyi-visual-monitor.jar +# 启动系统服务 +ENTRYPOINT ["java","-jar","ruoyi-visual-monitor.jar"] \ No newline at end of file diff --git a/docker/ruoyi/visual/monitor/jar/readme.txt b/docker/ruoyi/visual/monitor/jar/readme.txt new file mode 100644 index 00000000..62b28410 --- /dev/null +++ b/docker/ruoyi/visual/monitor/jar/readme.txt @@ -0,0 +1 @@ +żĴõjarļdockerӦá \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8bde0590..7db7d404 100644 --- a/pom.xml +++ b/pom.xml @@ -6,30 +6,30 @@ com.ruoyi ruoyi - 2.5.0 + 3.0.0 ruoyi http://www.ruoyi.vip 若依微服务系统 - 2.5.0 + 3.0.0 UTF-8 UTF-8 1.8 - 2.5.0 - 2020.0.2 + 2.5.1 + 2020.0.3 2021.1 - 2.0.1 - 2.4.1 + 2.0.2 + 2.4.1 2.1.4 - 2.9.2 - 1.5.24 + 3.0.0 + 1.6.2 1.26.5 2.3.2 1.3.0 1.2.6 - 3.3.2 + 3.4.0 2.5 1.3.3 1.7 diff --git a/ruoyi-api/pom.xml b/ruoyi-api/pom.xml index 1c24fbc5..6ab71617 100644 --- a/ruoyi-api/pom.xml +++ b/ruoyi-api/pom.xml @@ -4,7 +4,7 @@ com.ruoyi ruoyi - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-api/ruoyi-api-system/pom.xml b/ruoyi-api/ruoyi-api-system/pom.xml index 5c8b3af0..19afb305 100644 --- a/ruoyi-api/ruoyi-api-system/pom.xml +++ b/ruoyi-api/ruoyi-api-system/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi-api - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java index 2f9bcb08..6a560f11 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java @@ -33,8 +33,8 @@ public class SysRole extends BaseEntity @Excel(name = "角色排序") private String roleSort; - /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限) */ - @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限") + /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ + @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") private String dataScope; /** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */ diff --git a/ruoyi-auth/pom.xml b/ruoyi-auth/pom.xml index 41652aa8..638660e2 100644 --- a/ruoyi-auth/pom.xml +++ b/ruoyi-auth/pom.xml @@ -4,7 +4,7 @@ com.ruoyi ruoyi - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index df16e1da..050f9b52 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -4,7 +4,7 @@ com.ruoyi ruoyi - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-common/ruoyi-common-core/pom.xml b/ruoyi-common/ruoyi-common-core/pom.xml index ff8ed86d..0426a88f 100644 --- a/ruoyi-common/ruoyi-common-core/pom.xml +++ b/ruoyi-common/ruoyi-common-core/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi-common - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/ImageUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/ImageUtils.java index f8fa776a..061c2a79 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/ImageUtils.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/ImageUtils.java @@ -80,6 +80,7 @@ public class ImageUtils } finally { + IOUtils.closeQuietly(in); IOUtils.closeQuietly(baos); } } diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java index 426d37d8..48c3d28a 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java @@ -36,6 +36,7 @@ import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFClientAnchor; import org.apache.poi.xssf.usermodel.XSSFDataValidation; @@ -179,7 +180,8 @@ public class ExcelUtil throw new IOException("文件sheet不存在"); } - int rows = sheet.getPhysicalNumberOfRows(); + // 获取最后一个非空行的行下标,比如总行数为n,则返回的为n-1 + int rows = sheet.getLastRowNum(); if (rows > 0) { @@ -219,10 +221,15 @@ public class ExcelUtil } } } - for (int i = 1; i < rows; i++) + for (int i = 1; i <= rows; i++) { // 从第2行开始取数据,默认第一行是表头. Row row = sheet.getRow(i); + // 判断当前行是否是空行 + if (isRowEmpty(row)) + { + continue; + } T entity = null; for (Map.Entry entry : fieldsMap.entrySet()) { @@ -321,7 +328,7 @@ public class ExcelUtil */ public void exportExcel(HttpServletResponse response, List list, String sheetName) throws IOException { - response.setContentType("application/vnd.ms-excel"); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setCharacterEncoding("utf-8"); this.init(list, sheetName, Type.EXPORT); exportExcel(response.getOutputStream()); @@ -335,7 +342,7 @@ public class ExcelUtil */ public void importTemplateExcel(HttpServletResponse response, String sheetName) throws IOException { - response.setContentType("application/vnd.ms-excel"); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setCharacterEncoding("utf-8"); this.init(null, sheetName, Type.IMPORT); exportExcel(response.getOutputStream()); @@ -346,32 +353,12 @@ public class ExcelUtil * * @return 结果 */ - public void exportExcel(OutputStream outputStream) + public void exportExcel(OutputStream out) { try { - // 取出一共有多少个sheet. - double sheetNo = Math.ceil(list.size() / sheetSize); - for (int index = 0; index <= sheetNo; index++) - { - createSheet(sheetNo, index); - - // 产生一行 - Row row = sheet.createRow(0); - int column = 0; - // 写入各个字段的列头名称 - for (Object[] os : fields) - { - Excel excel = (Excel) os[1]; - this.createCell(excel, row, column++); - } - if (Type.EXPORT.equals(type)) - { - fillExcelData(index, row); - addStatisticsRow(); - } - } - wb.write(outputStream); + writeSheet(); + wb.write(out); } catch (Exception e) { @@ -379,27 +366,35 @@ public class ExcelUtil } finally { - if (wb != null) + IOUtils.closeQuietly(wb); + IOUtils.closeQuietly(out); + } + } + + /** + * 创建写入数据到Sheet + */ + public void writeSheet() + { + // 取出一共有多少个sheet. + double sheetNo = Math.ceil(list.size() / sheetSize); + for (int index = 0; index <= sheetNo; index++) + { + createSheet(sheetNo, index); + + // 产生一行 + Row row = sheet.createRow(0); + int column = 0; + // 写入各个字段的列头名称 + for (Object[] os : fields) { - try - { - wb.close(); - } - catch (IOException e1) - { - e1.printStackTrace(); - } + Excel excel = (Excel) os[1]; + this.createCell(excel, row, column++); } - if (outputStream != null) + if (Type.EXPORT.equals(type)) { - try - { - outputStream.close(); - } - catch (IOException e1) - { - e1.printStackTrace(); - } + fillExcelData(index, row); + addStatisticsRow(); } } } @@ -535,8 +530,7 @@ public class ExcelUtil } else if (ColumnType.IMAGE == attr.cellType()) { - ClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) cell.getColumnIndex(), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() + 1), - cell.getRow().getRowNum() + 1); + ClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) cell.getColumnIndex(), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() + 1), cell.getRow().getRowNum() + 1); String imagePath = Convert.toStr(value); if (StringUtils.isNotEmpty(imagePath)) { @@ -546,7 +540,7 @@ public class ExcelUtil } } } - + /** * 获取画布 */ @@ -1028,4 +1022,27 @@ public class ExcelUtil } return val; } + + /** + * 判断是否是空行 + * + * @param row 判断的行 + * @return + */ + private boolean isRowEmpty(Row row) + { + if (row == null) + { + return true; + } + for (int i = row.getFirstCellNum(); i < row.getLastCellNum(); i++) + { + Cell cell = row.getCell(i); + if (cell != null && cell.getCellType() != CellType.BLANK) + { + return false; + } + } + return true; + } } \ No newline at end of file diff --git a/ruoyi-common/ruoyi-common-datascope/pom.xml b/ruoyi-common/ruoyi-common-datascope/pom.xml index 2fbc8f61..d1ac37cd 100644 --- a/ruoyi-common/ruoyi-common-datascope/pom.xml +++ b/ruoyi-common/ruoyi-common-datascope/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi-common - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-common/ruoyi-common-datasource/pom.xml b/ruoyi-common/ruoyi-common-datasource/pom.xml index 36d29da9..8fde2051 100644 --- a/ruoyi-common/ruoyi-common-datasource/pom.xml +++ b/ruoyi-common/ruoyi-common-datasource/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi-common - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-common/ruoyi-common-log/pom.xml b/ruoyi-common/ruoyi-common-log/pom.xml index fe322d1c..91c14901 100644 --- a/ruoyi-common/ruoyi-common-log/pom.xml +++ b/ruoyi-common/ruoyi-common-log/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi-common - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-common/ruoyi-common-redis/pom.xml b/ruoyi-common/ruoyi-common-redis/pom.xml index e498f15b..a68652ed 100644 --- a/ruoyi-common/ruoyi-common-redis/pom.xml +++ b/ruoyi-common/ruoyi-common-redis/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi-common - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-common/ruoyi-common-security/pom.xml b/ruoyi-common/ruoyi-common-security/pom.xml index 3ee61b18..99b7b8ab 100644 --- a/ruoyi-common/ruoyi-common-security/pom.xml +++ b/ruoyi-common/ruoyi-common-security/pom.xml @@ -4,7 +4,7 @@ com.ruoyi ruoyi-common - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-common/ruoyi-common-swagger/pom.xml b/ruoyi-common/ruoyi-common-swagger/pom.xml index 8999bb37..50e97bd5 100644 --- a/ruoyi-common/ruoyi-common-swagger/pom.xml +++ b/ruoyi-common/ruoyi-common-swagger/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi-common - 2.5.0 + 3.0.0 4.0.0 @@ -16,19 +16,19 @@ - + org.springframework.boot spring-boot-starter-web - + io.springfox springfox-swagger2 ${swagger.fox.version} - + diff --git a/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerAutoConfiguration.java b/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerAutoConfiguration.java index 1a9597dc..39e9b3af 100644 --- a/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerAutoConfiguration.java +++ b/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerAutoConfiguration.java @@ -3,13 +3,12 @@ package com.ruoyi.common.swagger.config; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.function.Predicate; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; @@ -18,8 +17,10 @@ import springfox.documentation.service.ApiKey; import springfox.documentation.service.AuthorizationScope; import springfox.documentation.service.Contact; import springfox.documentation.service.SecurityReference; +import springfox.documentation.service.SecurityScheme; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.service.contexts.SecurityContext; +import springfox.documentation.spring.web.plugins.ApiSelectorBuilder; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @@ -60,27 +61,26 @@ public class SwaggerAutoConfiguration { swaggerProperties.getExcludePath().addAll(DEFAULT_EXCLUDE_PATH); } + List> excludePath = new ArrayList<>(); swaggerProperties.getExcludePath().forEach(path -> excludePath.add(PathSelectors.ant(path))); - //noinspection Guava - return new Docket(DocumentationType.SWAGGER_2) - .host(swaggerProperties.getHost()) + ApiSelectorBuilder builder = new Docket(DocumentationType.SWAGGER_2).host(swaggerProperties.getHost()) .apiInfo(apiInfo(swaggerProperties)).select() - .apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage())) - .paths(Predicates.and(Predicates.not(Predicates.or(excludePath)), Predicates.or(basePath))) - .build() - .securitySchemes(securitySchemes()) - .securityContexts(securityContexts()) - .pathMapping("/"); + .apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage())); + + swaggerProperties.getBasePath().forEach(p -> builder.paths(PathSelectors.ant(p))); + swaggerProperties.getExcludePath().forEach(p -> builder.paths(PathSelectors.ant(p).negate())); + + return builder.build().securitySchemes(securitySchemes()).securityContexts(securityContexts()).pathMapping("/"); } /** * 安全模式,这里指定token通过Authorization头请求头传递 */ - private List securitySchemes() + private List securitySchemes() { - List apiKeyList = new ArrayList(); + List apiKeyList = new ArrayList(); apiKeyList.add(new ApiKey("Authorization", "Authorization", "header")); return apiKeyList; } @@ -94,7 +94,7 @@ public class SwaggerAutoConfiguration securityContexts.add( SecurityContext.builder() .securityReferences(defaultAuth()) - .forPaths(PathSelectors.regex("^(?!auth).*$")) + .operationSelector(o -> o.requestMappingPattern().matches("/.*")) .build()); return securityContexts; } diff --git a/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerWebConfiguration.java b/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerWebConfiguration.java new file mode 100644 index 00000000..424e8c3c --- /dev/null +++ b/ruoyi-common/ruoyi-common-swagger/src/main/java/com/ruoyi/common/swagger/config/SwaggerWebConfiguration.java @@ -0,0 +1,22 @@ +package com.ruoyi.common.swagger.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * swagger 资源映射路径 + * + * @author ruoyi + */ +@Configuration +public class SwaggerWebConfiguration implements WebMvcConfigurer +{ + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) + { + /** swagger-ui 地址 */ + registry.addResourceHandler("/swagger-ui/**") + .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/"); + } +} \ No newline at end of file diff --git a/ruoyi-common/ruoyi-common-swagger/src/main/resources/META-INF/spring.factories b/ruoyi-common/ruoyi-common-swagger/src/main/resources/META-INF/spring.factories index 0cb7c0a1..d72ee804 100644 --- a/ruoyi-common/ruoyi-common-swagger/src/main/resources/META-INF/spring.factories +++ b/ruoyi-common/ruoyi-common-swagger/src/main/resources/META-INF/spring.factories @@ -1,2 +1,3 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - com.ruoyi.common.swagger.config.SwaggerAutoConfiguration + com.ruoyi.common.swagger.config.SwaggerAutoConfiguration,\ + com.ruoyi.common.swagger.config.SwaggerWebConfiguration \ No newline at end of file diff --git a/ruoyi-gateway/pom.xml b/ruoyi-gateway/pom.xml index d4432b40..5af57eac 100644 --- a/ruoyi-gateway/pom.xml +++ b/ruoyi-gateway/pom.xml @@ -4,7 +4,7 @@ com.ruoyi ruoyi - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java index 0da5fa06..67f18b7d 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java @@ -7,6 +7,8 @@ import org.springframework.cloud.gateway.config.GatewayProperties; import org.springframework.cloud.gateway.route.RouteLocator; import org.springframework.cloud.gateway.support.NameUtils; import org.springframework.stereotype.Component; +import org.springframework.web.reactive.config.ResourceHandlerRegistry; +import org.springframework.web.reactive.config.WebFluxConfigurer; import springfox.documentation.swagger.web.SwaggerResource; import springfox.documentation.swagger.web.SwaggerResourcesProvider; @@ -16,7 +18,7 @@ import springfox.documentation.swagger.web.SwaggerResourcesProvider; * @author ruoyi */ @Component -public class SwaggerProvider implements SwaggerResourcesProvider +public class SwaggerProvider implements SwaggerResourcesProvider, WebFluxConfigurer { /** * Swagger2默认的url后缀 @@ -63,4 +65,12 @@ public class SwaggerProvider implements SwaggerResourcesProvider swaggerResource.setSwaggerVersion("2.0"); return swaggerResource; } + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) + { + /** swagger-ui 地址 */ + registry.addResourceHandler("/swagger-ui/**") + .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/"); + } } diff --git a/ruoyi-modules/pom.xml b/ruoyi-modules/pom.xml index 0a4eb86d..01c9fac4 100644 --- a/ruoyi-modules/pom.xml +++ b/ruoyi-modules/pom.xml @@ -4,7 +4,7 @@ com.ruoyi ruoyi - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-modules/ruoyi-file/pom.xml b/ruoyi-modules/ruoyi-file/pom.xml index 947a5bf2..0c8015ef 100644 --- a/ruoyi-modules/ruoyi-file/pom.xml +++ b/ruoyi-modules/ruoyi-file/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi-modules - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-modules/ruoyi-gen/pom.xml b/ruoyi-modules/ruoyi-gen/pom.xml index c22e9cca..8e18387e 100644 --- a/ruoyi-modules/ruoyi-gen/pom.xml +++ b/ruoyi-modules/ruoyi-gen/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi-modules - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm index 6d67c2e0..ab870681 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm @@ -532,7 +532,7 @@ export default { }).then(() => { this.getList(); this.msgSuccess("删除成功"); - }) + }).catch(() => {}); } } }; diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm index d01c0799..57da66b1 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm @@ -587,7 +587,7 @@ export default { }).then(() => { this.getList(); this.msgSuccess("删除成功"); - }) + }).catch(() => {}); }, #if($table.sub) /** ${subTable.functionName}序号 */ diff --git a/ruoyi-modules/ruoyi-job/pom.xml b/ruoyi-modules/ruoyi-job/pom.xml index 7fd1bed6..9e1ca551 100644 --- a/ruoyi-modules/ruoyi-job/pom.xml +++ b/ruoyi-modules/ruoyi-job/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi-modules - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-modules/ruoyi-system/pom.xml b/ruoyi-modules/ruoyi-system/pom.xml index 532260ec..66a3c0f9 100644 --- a/ruoyi-modules/ruoyi-system/pom.xml +++ b/ruoyi-modules/ruoyi-system/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi-modules - 2.5.0 + 3.0.0 4.0.0 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java index db7cbf8e..980fc894 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java @@ -96,11 +96,11 @@ public interface SysDeptMapper public int updateDept(SysDept dept); /** - * 修改所在部门的父级部门状态 + * 修改所在部门正常状态 * - * @param dept 部门 + * @param deptIds 部门ID组 */ - public void updateDeptStatus(SysDept dept); + public void updateDeptStatusNormal(Long[] deptIds); /** * 修改子元素关系 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index ffd03901..ce25ac5d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.exception.CustomException; +import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.datascope.annotation.DataScope; import com.ruoyi.system.api.domain.SysDept; @@ -211,7 +212,7 @@ public class SysDeptServiceImpl implements ISysDeptService if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) { // 如果该部门是启用状态,则启用该部门的所有上级部门 - updateParentDeptStatus(dept); + updateParentDeptStatusNormal(dept); } return result; } @@ -221,12 +222,11 @@ public class SysDeptServiceImpl implements ISysDeptService * * @param dept 当前部门 */ - private void updateParentDeptStatus(SysDept dept) + private void updateParentDeptStatusNormal(SysDept dept) { - String updateBy = dept.getUpdateBy(); - dept = deptMapper.selectDeptById(dept.getDeptId()); - dept.setUpdateBy(updateBy); - deptMapper.updateDeptStatus(dept); + String ancestors = dept.getAncestors(); + Long[] deptIds = Convert.toLongArray(ancestors); + deptMapper.updateDeptStatusNormal(deptIds); } /** diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 17fecaa5..e3930a98 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -140,14 +140,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - update sys_dept - - status = #{status}, - update_by = #{updateBy}, - update_time = sysdate() - - where find_in_set(#{deptId}, ancestors) + + update sys_dept set status = '0' where dept_id in + + #{deptId} + diff --git a/ruoyi-ui/.env.development b/ruoyi-ui/.env.development index 0cb1c613..18b2a3ed 100644 --- a/ruoyi-ui/.env.development +++ b/ruoyi-ui/.env.development @@ -1,3 +1,6 @@ +# 页面标题 +VUE_APP_TITLE = 若依管理系统 + # 开发环境配置 ENV = 'development' diff --git a/ruoyi-ui/.env.production b/ruoyi-ui/.env.production index a8e4af3b..cb064ec8 100644 --- a/ruoyi-ui/.env.production +++ b/ruoyi-ui/.env.production @@ -1,3 +1,6 @@ +# 页面标题 +VUE_APP_TITLE = 若依管理系统 + # 生产环境配置 ENV = 'production' diff --git a/ruoyi-ui/.env.staging b/ruoyi-ui/.env.staging index 41d4817c..a47af9a2 100644 --- a/ruoyi-ui/.env.staging +++ b/ruoyi-ui/.env.staging @@ -1,3 +1,6 @@ +# 页面标题 +VUE_APP_TITLE = 若依管理系统 + NODE_ENV = production # 测试环境配置 diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index ad60e4e7..2c6cb5e5 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -1,6 +1,6 @@ { "name": "ruoyi", - "version": "2.5.0", + "version": "3.0.0", "description": "若依管理系统", "author": "若依", "license": "MIT", @@ -33,7 +33,7 @@ ], "repository": { "type": "git", - "url": "https://gitee.com/y_project/RuoYi-Vue.git" + "url": "https://gitee.com/y_project/RuoYi-Cloud.git" }, "dependencies": { "@riophae/vue-treeselect": "0.4.0", @@ -41,7 +41,7 @@ "clipboard": "2.0.6", "core-js": "3.8.1", "echarts": "4.9.0", - "element-ui": "2.15.0", + "element-ui": "2.15.2", "file-saver": "2.0.4", "fuse.js": "6.4.3", "highlight.js": "9.18.5", @@ -56,6 +56,7 @@ "vue-count-to": "1.0.13", "vue-cropper": "0.5.5", "vue-router": "3.4.9", + "vue-meta": "^2.4.0", "vuedraggable": "2.24.3", "vuex": "3.6.0" }, diff --git a/ruoyi-ui/src/App.vue b/ruoyi-ui/src/App.vue index 1d0634c3..60325ff4 100644 --- a/ruoyi-ui/src/App.vue +++ b/ruoyi-ui/src/App.vue @@ -6,6 +6,14 @@ diff --git a/ruoyi-ui/src/assets/styles/ruoyi.scss b/ruoyi-ui/src/assets/styles/ruoyi.scss index 55118fad..c40c9fb0 100644 --- a/ruoyi-ui/src/assets/styles/ruoyi.scss +++ b/ruoyi-ui/src/assets/styles/ruoyi.scss @@ -105,6 +105,15 @@ position: absolute; } +@media ( max-width : 768px) { + .pagination-container .el-pagination > .el-pagination__jump { + display: none !important; + } + .pagination-container .el-pagination > .el-pagination__sizes { + display: none !important; + } +} + .el-table .fixed-width .el-button--mini { padding-left: 0; padding-right: 0; diff --git a/ruoyi-ui/src/components/Editor/index.vue b/ruoyi-ui/src/components/Editor/index.vue index 6cb82a14..b67c3789 100644 --- a/ruoyi-ui/src/components/Editor/index.vue +++ b/ruoyi-ui/src/components/Editor/index.vue @@ -75,7 +75,7 @@ export default { [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色 [{ align: [] }], // 对齐方式 ["clean"], // 清除文本格式 - ["link", "image"] // 链接、图片 + ["link", "image", "video"] // 链接、图片、视频 ], }, placeholder: "请输入内容", @@ -165,7 +165,7 @@ export default { // 获取光标所在位置 let length = quill.getSelection().index; // 插入图片 res.url为服务器返回的图片地址 - quill.insertEmbed(length, "image", res.data.url); + quill.insertEmbed(length, "image", res.url); // 调整光标到最后 quill.setSelection(length + 1); } else { diff --git a/ruoyi-ui/src/components/Pagination/index.vue b/ruoyi-ui/src/components/Pagination/index.vue index 08ff0904..76d958bb 100644 --- a/ruoyi-ui/src/components/Pagination/index.vue +++ b/ruoyi-ui/src/components/Pagination/index.vue @@ -6,6 +6,7 @@ :page-size.sync="pageSize" :layout="layout" :page-sizes="pageSizes" + :pager-count="pagerCount" :total="total" v-bind="$attrs" @size-change="handleSizeChange" @@ -38,6 +39,11 @@ export default { return [10, 20, 30, 50] } }, + // 移动端页码按钮的数量端默认值5 + pagerCount: { + type: Number, + default: document.body.clientWidth < 992 ? 5 : 7 + }, layout: { type: String, default: 'total, sizes, prev, pager, next, jumper' diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index 18c89a0e..67a53ab6 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -104,7 +104,7 @@ export default { this.$store.dispatch('LogOut').then(() => { location.href = '/index'; }) - }) + }).catch(() => {}); } } } diff --git a/ruoyi-ui/src/layout/components/Settings/index.vue b/ruoyi-ui/src/layout/components/Settings/index.vue index efdc0fd0..0a6becac 100644 --- a/ruoyi-ui/src/layout/components/Settings/index.vue +++ b/ruoyi-ui/src/layout/components/Settings/index.vue @@ -62,6 +62,11 @@ +
+ 动态标题 + +
+ 保存配置 @@ -129,6 +134,17 @@ export default { }) } }, + dynamicTitle: { + get() { + return this.$store.state.settings.dynamicTitle + }, + set(val) { + this.$store.dispatch('settings/changeSetting', { + key: 'dynamicTitle', + value: val + }) + } + }, }, methods: { themeChange(val) { @@ -160,6 +176,7 @@ export default { "tagsView":${this.tagsView}, "fixedHeader":${this.fixedHeader}, "sidebarLogo":${this.sidebarLogo}, + "dynamicTitle":${this.dynamicTitle}, "sideTheme":"${this.sideTheme}", "theme":"${this.theme}" }` diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index e81fda33..0fd52ced 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -21,6 +21,8 @@ import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, import Pagination from "@/components/Pagination"; // 自定义表格工具扩展 import RightToolbar from "@/components/RightToolbar" +// 头部标签插件 +import VueMeta from 'vue-meta' // 全局方法挂载 Vue.prototype.getDicts = getDicts @@ -50,6 +52,7 @@ Vue.component('Pagination', Pagination) Vue.component('RightToolbar', RightToolbar) Vue.use(permission) +Vue.use(VueMeta) /** * If you don't want to use mock-server diff --git a/ruoyi-ui/src/permission.js b/ruoyi-ui/src/permission.js index ae0bda25..bde52936 100644 --- a/ruoyi-ui/src/permission.js +++ b/ruoyi-ui/src/permission.js @@ -12,6 +12,7 @@ const whiteList = ['/login', '/auth-redirect', '/bind', '/register'] router.beforeEach((to, from, next) => { NProgress.start() if (getToken()) { + to.meta.title && store.dispatch('settings/setTitle', to.meta.title) /* has token*/ if (to.path === '/login') { next({ path: '/' }) diff --git a/ruoyi-ui/src/settings.js b/ruoyi-ui/src/settings.js index 0e74c710..059c74d7 100644 --- a/ruoyi-ui/src/settings.js +++ b/ruoyi-ui/src/settings.js @@ -1,6 +1,4 @@ module.exports = { - title: '若依管理系统', - /** * 侧边栏主题 深色主题theme-dark,浅色主题theme-light */ @@ -31,6 +29,11 @@ module.exports = { */ sidebarLogo: true, + /** + * 是否显示动态标题 + */ + dynamicTitle: false, + /** * @type {string | array} 'production' | ['production', 'development'] * @description Need show err logs component. diff --git a/ruoyi-ui/src/store/modules/settings.js b/ruoyi-ui/src/store/modules/settings.js index aeedaba1..285c93e2 100644 --- a/ruoyi-ui/src/store/modules/settings.js +++ b/ruoyi-ui/src/store/modules/settings.js @@ -1,17 +1,19 @@ import variables from '@/assets/styles/element-variables.scss' import defaultSettings from '@/settings' -const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo } = defaultSettings +const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || '' const state = { + title: '', theme: storageSetting.theme || variables.theme, sideTheme: storageSetting.sideTheme || sideTheme, showSettings: showSettings, 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 + sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo, + dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle } const mutations = { CHANGE_SETTING: (state, { key, value }) => { @@ -22,8 +24,13 @@ const mutations = { } const actions = { + // 修改布局设置 changeSetting({ commit }, data) { commit('CHANGE_SETTING', data) + }, + // 设置网页标题 + setTitle({ commit }, title) { + state.title = title } } diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index 24351b0d..14879eb0 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -65,7 +65,7 @@ service.interceptors.response.use(res => { store.dispatch('LogOut').then(() => { location.href = '/index'; }) - }) + }).catch(() => {}); } else if (code === 500) { Message({ message: msg, diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index 05b218fb..69d144d2 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -146,6 +146,62 @@ 更新日志 + +
    +
  1. 新增菜单导航显示风格TopNav(false为左侧导航菜单,true为顶部导航菜单)
  2. +
  3. 布局设置支持保存&重置配置
  4. +
  5. 富文本编辑器支持自定义上传地址
  6. +
  7. 富文本编辑组件新增readOnly属性
  8. +
  9. 优化参数&字典缓存操作
  10. +
  11. 新增IE浏览器版本过低提示页面
  12. +
  13. 页签TagsView新增关闭右侧功能
  14. +
  15. 显隐列组件加载初始默认隐藏列
  16. +
  17. 关闭头像上传窗口还原默认图片
  18. +
  19. 个人信息添加手机&邮箱重复验证
  20. +
  21. 代码生成模板树表操作列添加新增按钮
  22. +
  23. 代码生成模板修复主子表字段重名问题
  24. +
  25. 支持docker部署项目
  26. +
  27. 升级springcloud到最新版2020.0.3
  28. +
  29. 升级spring-boot-alibaba到最新版2021.1
  30. +
  31. 升级nacos到最新版2.0.1 性能提升
  32. +
  33. 升级spring-boot到最新版本2.5.0
  34. +
  35. 升级spring-boot-admin到最新版2.4.1
  36. +
  37. 升级swagger到最新版本3.0.0
  38. +
  39. 升级mybatis到最新版3.5.6
  40. +
  41. 升级dynamic-ds到最新版本3.3.2
  42. +
  43. 升级minio到最新版本8.2.1
  44. +
  45. 升级fastjson到最新版1.2.76
  46. +
  47. 升级druid到最新版本v1.2.6
  48. +
  49. 修复四级菜单无法显示问题
  50. +
  51. 修复树表数据显示不全&加载慢问题
  52. +
  53. 修复关闭confirm提示框控制台报错问题
  54. +
  55. 上传媒体类型添加视频格式
  56. +
  57. 增加feign客户端IP头部信息
  58. +
  59. 修复两处存在SQL注入漏洞问题
  60. +
  61. 优化图片工具类读取文件,防止异常
  62. +
  63. 修复导出角色数据范围翻译缺少仅本人
  64. +
  65. 修复表单构建选择下拉选择控制台报错问题
  66. +
  67. 修复请求形参未传值记录日志异常问题
  68. +
  69. 调整sql默认为当前时间
  70. +
  71. 修改ip字段长度防止ipv6地址长度不够
  72. +
  73. 删除操作日志记录信息
  74. +
  75. 修复firefox下表单构建拖拽会新打卡一个选项卡
  76. +
  77. 用户&角色单条删除时使其逻辑删除
  78. +
  79. 优化树表代码生成模板
  80. +
  81. 修正通知公告日志记录类型
  82. +
  83. 修正后端导入表权限标识
  84. +
  85. 过滤BindingResult对象,防止异常
  86. +
  87. Redis设置HashKey序列化
  88. +
  89. 优化Excel导入增加空行判断
  90. +
  91. 树级结构更新子节点使用replaceFirst
  92. +
  93. 富文本工具栏配置视频
  94. +
  95. 修正模板字符编码
  96. +
  97. 优化通用下载完成后删除节点
  98. +
  99. 角色非自定义权限范围清空选择值
  100. +
  101. 修改主题后mini类型按钮无效问题
  102. +
  103. 其他细节优化
  104. +
+
  1. 增加分布式事务seata支持
  2. @@ -449,7 +505,7 @@ export default { data() { return { // 版本号 - version: "2.5.0", + version: "3.0.0", }; }, methods: { diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue index d11de4a9..424286af 100644 --- a/ruoyi-ui/src/views/monitor/job/index.vue +++ b/ruoyi-ui/src/views/monitor/job/index.vue @@ -407,7 +407,7 @@ export default { return runJob(row.jobId, row.jobGroup); }).then(() => { this.msgSuccess("执行成功"); - }) + }).catch(() => {}); }, /** 任务详细信息 */ handleView(row) { diff --git a/ruoyi-ui/src/views/monitor/online/index.vue b/ruoyi-ui/src/views/monitor/online/index.vue index 69206256..90e6e19c 100644 --- a/ruoyi-ui/src/views/monitor/online/index.vue +++ b/ruoyi-ui/src/views/monitor/online/index.vue @@ -116,7 +116,7 @@ export default { }).then(() => { this.getList(); this.msgSuccess("强退成功"); - }) + }).catch(() => {}); } } }; diff --git a/ruoyi-ui/src/views/system/config/index.vue b/ruoyi-ui/src/views/system/config/index.vue index abfb2481..b692d2cc 100644 --- a/ruoyi-ui/src/views/system/config/index.vue +++ b/ruoyi-ui/src/views/system/config/index.vue @@ -335,7 +335,7 @@ export default { }).then(() => { this.getList(); this.msgSuccess("删除成功"); - }) + }).catch(() => {}); }, /** 导出按钮操作 */ handleExport() { diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue index 47e14935..2d58f642 100644 --- a/ruoyi-ui/src/views/system/dept/index.vue +++ b/ruoyi-ui/src/views/system/dept/index.vue @@ -178,7 +178,7 @@ export default { { required: true, message: "部门名称不能为空", trigger: "blur" } ], orderNum: [ - { required: true, message: "菜单顺序不能为空", trigger: "blur" } + { required: true, message: "显示排序不能为空", trigger: "blur" } ], email: [ { @@ -310,7 +310,7 @@ export default { }).then(() => { this.getList(); this.msgSuccess("删除成功"); - }) + }).catch(() => {}); } } }; diff --git a/ruoyi-ui/src/views/system/dict/data.vue b/ruoyi-ui/src/views/system/dict/data.vue index 994833e1..0e5e21e9 100644 --- a/ruoyi-ui/src/views/system/dict/data.vue +++ b/ruoyi-ui/src/views/system/dict/data.vue @@ -1,6 +1,6 @@