mirror of
https://gitee.com/y_project/RuoYi-Vue.git
synced 2025-12-20 20:36:39 +08:00
Compare commits
162 Commits
springboot
...
v3.9.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 4615293be9 | |||
| ba5cf9de6e | |||
| 6de392bac2 | |||
| 49f62e565a | |||
| 5579b57bef | |||
| 88609b3b24 | |||
| 03f3f47397 | |||
| b5400d962b | |||
| e7ef3241c5 | |||
| eb6878e18f | |||
| 8499225192 | |||
| 4a5e45d160 | |||
| 188e50ff1c | |||
| bd66cc7260 | |||
| 866b47000c | |||
| f38f8b2c3e | |||
| faa86ac946 | |||
| ad280e824c | |||
| 6e1aa42ebe | |||
| 315901041f | |||
| 91263711d4 | |||
| 9372d3401f | |||
| 0eaa090f4b | |||
| a5adee3c5f | |||
| 075e96466f | |||
| 41496b6d8a | |||
| 4a401984c1 | |||
| e5faee66c8 | |||
| 7558c176eb | |||
| 4a5b0e6079 | |||
| 08637e31e5 | |||
| 512b157801 | |||
| 5e8efaa94a | |||
| 5f11fed41b | |||
| b60b5de750 | |||
| 41ff3843e6 | |||
| 6a2e8a35e9 | |||
| 769165575f | |||
| 18c8d4ec9c | |||
| 191fd29301 | |||
| 47510fe2de | |||
| 725c7dcea2 | |||
| 158ccaebe0 | |||
| 7b9060af26 | |||
| 1a2f20e859 | |||
| 09faecb5d3 | |||
| d46e62a21a | |||
| fa88922637 | |||
| 65159934ab | |||
| 1642bba612 | |||
| a7a61fee8d | |||
| db6d5d34e6 | |||
| 9ceca3a68e | |||
| cf2579612c | |||
| c0355a0f5a | |||
| 8ff013552a | |||
| 673249d373 | |||
| fe3a92a812 | |||
| 67b6a0e11b | |||
| bc70351e34 | |||
| fe0c1fcb5b | |||
| 9f39dfd0c1 | |||
| 131abe876d | |||
| 46708ceee4 | |||
| ecd201550f | |||
| ff3f3f2631 | |||
| d3cc8f0fb7 | |||
| 6cafa3373e | |||
| 42fbf09dde | |||
| 88b0f5bcb2 | |||
| e852fdb687 | |||
| baf2f6f46b | |||
| e19f1abfeb | |||
| 38ed092de7 | |||
| 27a037ed3d | |||
| 87173cbe75 | |||
| 29a5b6da53 | |||
| b1d2139559 | |||
| 43d78c2cf5 | |||
| 8f4eb24bf2 | |||
| a9f9133e31 | |||
| 09810ccf1d | |||
| 0d9fb8b5c0 | |||
| c6b0efcdc2 | |||
| 84fef1f675 | |||
| 11fed08b56 | |||
| f83b6fbfa2 | |||
| eef81e6ca9 | |||
| 5a03a754e8 | |||
| 245dea7215 | |||
| 51632f8e60 | |||
| 525ebf92d2 | |||
| d3b23a831e | |||
| 89ab3bd058 | |||
| 9e16beb48f | |||
| 8d5ecc7ff4 | |||
| 6e314dd3e8 | |||
| 193c256e71 | |||
| 4df52a6b40 | |||
| 079b7eeecf | |||
| ba24010709 | |||
| bd257f85e6 | |||
| 40c7ca34a8 | |||
| 1ef73d7360 | |||
| bd233fd62f | |||
| fabddc518a | |||
| ca61b6c68d | |||
| 51e5cf2a09 | |||
| 00acc37916 | |||
| 511ff0f125 | |||
| bf46e38c29 | |||
| 698a5198d9 | |||
| 5e6c917ab0 | |||
| 9a51563144 | |||
| 3b2704c181 | |||
| 7232217061 | |||
| 25fd29c5ea | |||
| 2d6a6a162f | |||
| 164c62743f | |||
| 4ee169b0c8 | |||
| d487ffc92f | |||
| 5a1e7bae2c | |||
| 1810f30491 | |||
| 6efceac460 | |||
| 77a6350460 | |||
| 58a21ff9d7 | |||
| 7f507f5dfa | |||
| a1a45ef7ac | |||
| b343308a97 | |||
| 0bf7457eb7 | |||
| 0f77f524d0 | |||
| 747d816be2 | |||
| 262d9e1ff0 | |||
| ab37956874 | |||
| 86ab3bf600 | |||
| f76908912e | |||
| 8df4c72ad1 | |||
| 6bdcbabc09 | |||
| 58fca720a9 | |||
| e4ccbc6601 | |||
| 430e6d4dea | |||
| a0e6295693 | |||
| 52ba823328 | |||
| 91ae9a164c | |||
| d3326987a4 | |||
| 4de087b1ad | |||
| 5b959b32d7 | |||
| 4358621473 | |||
| adb8d51932 | |||
| 08a5deb285 | |||
| dc9f3ee722 | |||
| 78bb30bb5f | |||
| 5fad997d38 | |||
| 22a795d041 | |||
| 8a0a3a03fe | |||
| ad86486285 | |||
| 3ef6000794 | |||
| f812e99a0d | |||
| 2feae7619f | |||
| 212e3b4977 | |||
| 99e66bf11c | |||
| a96d4bf2ed |
123
pom.xml
123
pom.xml
@ -16,44 +16,94 @@
|
|||||||
<ruoyi.version>3.9.1</ruoyi.version>
|
<ruoyi.version>3.9.1</ruoyi.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>17</java.version>
|
<java.version>1.8</java.version>
|
||||||
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
||||||
<mybatis-spring-boot.version>3.0.5</mybatis-spring-boot.version>
|
<spring-boot.version>2.5.15</spring-boot.version>
|
||||||
<druid.version>1.2.27</druid.version>
|
<druid.version>1.2.27</druid.version>
|
||||||
<yauaa.version>7.32.0</yauaa.version>
|
<yauaa.version>7.32.0</yauaa.version>
|
||||||
<swagger.version>3.0.0</swagger.version>
|
<swagger.version>3.0.0</swagger.version>
|
||||||
<kaptcha.version>2.3.3</kaptcha.version>
|
<kaptcha.version>2.3.3</kaptcha.version>
|
||||||
<pagehelper.boot.version>2.1.1</pagehelper.boot.version>
|
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
|
||||||
<fastjson.version>2.0.60</fastjson.version>
|
<fastjson.version>2.0.60</fastjson.version>
|
||||||
<oshi.version>6.9.1</oshi.version>
|
<oshi.version>6.9.1</oshi.version>
|
||||||
<commons.io.version>2.21.0</commons.io.version>
|
<commons.io.version>2.21.0</commons.io.version>
|
||||||
<poi.version>4.1.2</poi.version>
|
<poi.version>4.1.2</poi.version>
|
||||||
<velocity.version>2.3</velocity.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
<jwt.version>0.9.1</jwt.version>
|
<jwt.version>0.9.1</jwt.version>
|
||||||
<quartz.version>2.5.2</quartz.version>
|
<!-- override dependency version -->
|
||||||
<mysql.version>8.2.0</mysql.version>
|
<tomcat.version>9.0.112</tomcat.version>
|
||||||
<jaxb-api.version>2.3.1</jaxb-api.version>
|
<logback.version>1.2.13</logback.version>
|
||||||
<jakarta.version>6.0.0</jakarta.version>
|
<spring-security.version>5.7.14</spring-security.version>
|
||||||
<springdoc.version>2.8.14</springdoc.version>
|
<spring-framework.version>5.3.39</spring-framework.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 依赖声明 -->
|
<!-- 依赖声明 -->
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- 覆盖SpringFramework的依赖配置-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-framework-bom</artifactId>
|
||||||
|
<version>${spring-framework.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 覆盖SpringSecurity的依赖配置-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-bom</artifactId>
|
||||||
|
<version>${spring-security.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot的依赖配置-->
|
<!-- SpringBoot的依赖配置-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-dependencies</artifactId>
|
<artifactId>spring-boot-dependencies</artifactId>
|
||||||
<version>3.5.8</version>
|
<version>${spring-boot.version}</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 覆盖logback的依赖配置-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-core</artifactId>
|
||||||
|
<version>${logback.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-classic</artifactId>
|
||||||
|
<version>${logback.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 覆盖tomcat的依赖配置-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
|
<artifactId>tomcat-embed-core</artifactId>
|
||||||
|
<version>${tomcat.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
|
<artifactId>tomcat-embed-el</artifactId>
|
||||||
|
<version>${tomcat.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
|
<artifactId>tomcat-embed-websocket</artifactId>
|
||||||
|
<version>${tomcat.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 阿里数据库连接池 -->
|
<!-- 阿里数据库连接池 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
<version>${druid.version}</version>
|
<version>${druid.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@ -71,30 +121,6 @@
|
|||||||
<version>${pagehelper.boot.version}</version>
|
<version>${pagehelper.boot.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
|
||||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
|
||||||
<version>${mybatis-spring-boot.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
|
||||||
<version>${mysql.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.xml.bind</groupId>
|
|
||||||
<artifactId>jaxb-api</artifactId>
|
|
||||||
<version>${jaxb-api.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>jakarta.servlet</groupId>
|
|
||||||
<artifactId>jakarta.servlet-api</artifactId>
|
|
||||||
<version>${jakarta.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 获取系统信息 -->
|
<!-- 获取系统信息 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.oshi</groupId>
|
<groupId>com.github.oshi</groupId>
|
||||||
@ -102,11 +128,17 @@
|
|||||||
<version>${oshi.version}</version>
|
<version>${oshi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- spring-doc -->
|
<!-- Swagger3依赖 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springdoc</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
<artifactId>springfox-boot-starter</artifactId>
|
||||||
<version>${springdoc.version}</version>
|
<version>${swagger.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-models</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- io常用工具类 -->
|
<!-- io常用工具类 -->
|
||||||
@ -130,13 +162,6 @@
|
|||||||
<version>${velocity.version}</version>
|
<version>${velocity.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 定时任务 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.quartz-scheduler</groupId>
|
|
||||||
<artifactId>quartz</artifactId>
|
|
||||||
<version>${quartz.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 阿里JSON解析器 -->
|
<!-- 阿里JSON解析器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.fastjson2</groupId>
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
@ -211,19 +236,13 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.13.0</version>
|
<version>3.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<parameters>true</parameters>
|
|
||||||
<source>${java.version}</source>
|
<source>${java.version}</source>
|
||||||
<target>${java.version}</target>
|
<target>${java.version}</target>
|
||||||
<encoding>${project.build.sourceEncoding}</encoding>
|
<encoding>${project.build.sourceEncoding}</encoding>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
<version>3.3.0</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|||||||
@ -24,16 +24,23 @@
|
|||||||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- spring-doc -->
|
<!-- swagger3-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springdoc</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
<artifactId>springfox-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-models</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Mysql驱动包 -->
|
<!-- Mysql驱动包 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 核心模块-->
|
<!-- 核心模块-->
|
||||||
@ -61,9 +68,9 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<version>3.5.4</version>
|
<version>2.5.15</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<addResources>true</addResources>
|
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|||||||
@ -3,9 +3,9 @@ package com.ruoyi.web.controller.common;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import jakarta.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.util.FastByteArrayOutputStream;
|
import org.springframework.util.FastByteArrayOutputStream;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|||||||
@ -2,8 +2,8 @@ package com.ruoyi.web.controller.common;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|||||||
@ -45,7 +45,6 @@ public class CacheController
|
|||||||
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
|
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public AjaxResult getInfo() throws Exception
|
public AjaxResult getInfo() throws Exception
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.web.controller.monitor;
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.web.controller.monitor;
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package com.ruoyi.web.controller.system;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package com.ruoyi.web.controller.system;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|||||||
@ -15,16 +15,19 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* swagger 用户测试方法
|
* swagger 用户测试方法
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Tag(name = "用户信息管理")
|
@Api("用户信息管理")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/test/user")
|
@RequestMapping("/test/user")
|
||||||
public class TestController extends BaseController
|
public class TestController extends BaseController
|
||||||
@ -34,19 +37,19 @@ public class TestController extends BaseController
|
|||||||
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
|
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
|
||||||
users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
|
users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "获取用户列表")
|
@ApiOperation("获取用户列表")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public R<List<UserEntity>> userList()
|
public R<List<UserEntity>> userList()
|
||||||
{
|
{
|
||||||
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
|
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
|
||||||
return R.ok(userList);
|
return R.ok(userList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "获取用户详细")
|
@ApiOperation("获取用户详细")
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||||
@GetMapping("/{userId}")
|
@GetMapping("/{userId}")
|
||||||
public R<UserEntity> getUser(@PathVariable(name = "userId")
|
public R<UserEntity> getUser(@PathVariable Integer userId)
|
||||||
Integer userId)
|
|
||||||
{
|
{
|
||||||
if (!users.isEmpty() && users.containsKey(userId))
|
if (!users.isEmpty() && users.containsKey(userId))
|
||||||
{
|
{
|
||||||
@ -57,8 +60,14 @@ public class TestController extends BaseController
|
|||||||
return R.fail("用户不存在");
|
return R.fail("用户不存在");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "新增用户")
|
@ApiOperation("新增用户")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
|
||||||
|
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
|
||||||
|
})
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public R<String> save(UserEntity user)
|
public R<String> save(UserEntity user)
|
||||||
{
|
{
|
||||||
@ -69,11 +78,10 @@ public class TestController extends BaseController
|
|||||||
users.put(user.getUserId(), user);
|
users.put(user.getUserId(), user);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "更新用户")
|
@ApiOperation("更新用户")
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
public R<String> update(@RequestBody
|
public R<String> update(@RequestBody UserEntity user)
|
||||||
UserEntity user)
|
|
||||||
{
|
{
|
||||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
||||||
{
|
{
|
||||||
@ -87,11 +95,11 @@ public class TestController extends BaseController
|
|||||||
users.put(user.getUserId(), user);
|
users.put(user.getUserId(), user);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "删除用户信息")
|
@ApiOperation("删除用户信息")
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||||
@DeleteMapping("/{userId}")
|
@DeleteMapping("/{userId}")
|
||||||
public R<String> delete(@PathVariable(name = "userId")
|
public R<String> delete(@PathVariable Integer userId)
|
||||||
Integer userId)
|
|
||||||
{
|
{
|
||||||
if (!users.isEmpty() && users.containsKey(userId))
|
if (!users.isEmpty() && users.containsKey(userId))
|
||||||
{
|
{
|
||||||
@ -105,26 +113,26 @@ public class TestController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Schema(description = "用户实体")
|
@ApiModel(value = "UserEntity", description = "用户实体")
|
||||||
class UserEntity
|
class UserEntity
|
||||||
{
|
{
|
||||||
@Schema(title = "用户ID")
|
@ApiModelProperty("用户ID")
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
@Schema(title = "用户名称")
|
@ApiModelProperty("用户名称")
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
@Schema(title = "用户密码")
|
@ApiModelProperty("用户密码")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
@Schema(title = "用户手机")
|
@ApiModelProperty("用户手机")
|
||||||
private String mobile;
|
private String mobile;
|
||||||
|
|
||||||
public UserEntity()
|
public UserEntity()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserEntity(Integer userId, String username, String password, String mobile)
|
public UserEntity(Integer userId, String username, String password, String mobile)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
@ -132,42 +140,42 @@ class UserEntity
|
|||||||
this.password = password;
|
this.password = password;
|
||||||
this.mobile = mobile;
|
this.mobile = mobile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getUserId()
|
public Integer getUserId()
|
||||||
{
|
{
|
||||||
return userId;
|
return userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserId(Integer userId)
|
public void setUserId(Integer userId)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUsername()
|
public String getUsername()
|
||||||
{
|
{
|
||||||
return username;
|
return username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsername(String username)
|
public void setUsername(String username)
|
||||||
{
|
{
|
||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPassword()
|
public String getPassword()
|
||||||
{
|
{
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPassword(String password)
|
public void setPassword(String password)
|
||||||
{
|
{
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMobile()
|
public String getMobile()
|
||||||
{
|
{
|
||||||
return mobile;
|
return mobile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMobile(String mobile)
|
public void setMobile(String mobile)
|
||||||
{
|
{
|
||||||
this.mobile = mobile;
|
this.mobile = mobile;
|
||||||
|
|||||||
@ -1,15 +1,26 @@
|
|||||||
package com.ruoyi.web.core.config;
|
package com.ruoyi.web.core.config;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
import com.ruoyi.common.config.RuoYiConfig;
|
||||||
import io.swagger.v3.oas.models.Components;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.models.auth.In;
|
||||||
import io.swagger.v3.oas.models.info.Contact;
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
import io.swagger.v3.oas.models.info.Info;
|
import springfox.documentation.builders.PathSelectors;
|
||||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
import springfox.documentation.service.ApiInfo;
|
||||||
|
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.Docket;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swagger2的接口配置
|
* Swagger2的接口配置
|
||||||
@ -22,43 +33,93 @@ public class SwaggerConfig
|
|||||||
/** 系统基础配置 */
|
/** 系统基础配置 */
|
||||||
@Autowired
|
@Autowired
|
||||||
private RuoYiConfig ruoyiConfig;
|
private RuoYiConfig ruoyiConfig;
|
||||||
|
|
||||||
|
/** 是否开启swagger */
|
||||||
|
@Value("${swagger.enabled}")
|
||||||
|
private boolean enabled;
|
||||||
|
|
||||||
|
/** 设置请求的统一前缀 */
|
||||||
|
@Value("${swagger.pathMapping}")
|
||||||
|
private String pathMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义的 OpenAPI 对象
|
* 创建API
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public OpenAPI customOpenApi()
|
public Docket createRestApi()
|
||||||
{
|
{
|
||||||
return new OpenAPI().components(new Components()
|
return new Docket(DocumentationType.OAS_30)
|
||||||
// 设置认证的请求头
|
// 是否启用Swagger
|
||||||
.addSecuritySchemes("apikey", securityScheme()))
|
.enable(enabled)
|
||||||
.addSecurityItem(new SecurityRequirement().addList("apikey"))
|
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||||
.info(getApiInfo());
|
.apiInfo(apiInfo())
|
||||||
|
// 设置哪些接口暴露给Swagger展示
|
||||||
|
.select()
|
||||||
|
// 扫描所有有注解的api,用这种方式更灵活
|
||||||
|
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||||
|
// 扫描指定包中的swagger注解
|
||||||
|
// .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
|
||||||
|
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||||
|
.paths(PathSelectors.any())
|
||||||
|
.build()
|
||||||
|
/* 设置安全模式,swagger可以设置访问token */
|
||||||
|
.securitySchemes(securitySchemes())
|
||||||
|
.securityContexts(securityContexts())
|
||||||
|
.pathMapping(pathMapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
/**
|
||||||
public SecurityScheme securityScheme()
|
* 安全模式,这里指定token通过Authorization头请求头传递
|
||||||
|
*/
|
||||||
|
private List<SecurityScheme> securitySchemes()
|
||||||
{
|
{
|
||||||
return new SecurityScheme()
|
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
|
||||||
.type(SecurityScheme.Type.APIKEY)
|
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
|
||||||
.name("Authorization")
|
return apiKeyList;
|
||||||
.in(SecurityScheme.In.HEADER)
|
|
||||||
.scheme("Bearer");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全上下文
|
||||||
|
*/
|
||||||
|
private List<SecurityContext> securityContexts()
|
||||||
|
{
|
||||||
|
List<SecurityContext> securityContexts = new ArrayList<>();
|
||||||
|
securityContexts.add(
|
||||||
|
SecurityContext.builder()
|
||||||
|
.securityReferences(defaultAuth())
|
||||||
|
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
|
||||||
|
.build());
|
||||||
|
return securityContexts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认的安全上引用
|
||||||
|
*/
|
||||||
|
private List<SecurityReference> defaultAuth()
|
||||||
|
{
|
||||||
|
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
|
||||||
|
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
||||||
|
authorizationScopes[0] = authorizationScope;
|
||||||
|
List<SecurityReference> securityReferences = new ArrayList<>();
|
||||||
|
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
|
||||||
|
return securityReferences;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加摘要信息
|
* 添加摘要信息
|
||||||
*/
|
*/
|
||||||
public Info getApiInfo()
|
private ApiInfo apiInfo()
|
||||||
{
|
{
|
||||||
return new Info()
|
// 用ApiInfoBuilder进行定制
|
||||||
// 设置标题
|
return new ApiInfoBuilder()
|
||||||
.title("标题:若依管理系统_接口文档")
|
// 设置标题
|
||||||
// 描述
|
.title("标题:若依管理系统_接口文档")
|
||||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
// 描述
|
||||||
// 作者信息
|
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||||
.contact(new Contact().name(ruoyiConfig.getName()))
|
// 作者信息
|
||||||
// 版本
|
.contact(new Contact(ruoyiConfig.getName(), null, null))
|
||||||
.version("版本号:" + ruoyiConfig.getVersion());
|
// 版本
|
||||||
|
.version("版本号:" + ruoyiConfig.getVersion())
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,29 +65,28 @@ spring:
|
|||||||
restart:
|
restart:
|
||||||
# 热部署开关
|
# 热部署开关
|
||||||
enabled: true
|
enabled: true
|
||||||
data:
|
# redis 配置
|
||||||
# redis 配置
|
redis:
|
||||||
redis:
|
# 地址
|
||||||
# 地址
|
host: localhost
|
||||||
host: localhost
|
# 端口,默认为6379
|
||||||
# 端口,默认为6379
|
port: 6379
|
||||||
port: 6379
|
# 数据库索引
|
||||||
# 数据库索引
|
database: 0
|
||||||
database: 0
|
# 密码
|
||||||
# 密码
|
password:
|
||||||
password:
|
# 连接超时时间
|
||||||
# 连接超时时间
|
timeout: 10s
|
||||||
timeout: 10s
|
lettuce:
|
||||||
lettuce:
|
pool:
|
||||||
pool:
|
# 连接池中的最小空闲连接
|
||||||
# 连接池中的最小空闲连接
|
min-idle: 0
|
||||||
min-idle: 0
|
# 连接池中的最大空闲连接
|
||||||
# 连接池中的最大空闲连接
|
max-idle: 8
|
||||||
max-idle: 8
|
# 连接池的最大数据库连接数
|
||||||
# 连接池的最大数据库连接数
|
max-active: 8
|
||||||
max-active: 8
|
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
max-wait: -1ms
|
||||||
max-wait: -1ms
|
|
||||||
|
|
||||||
# token配置
|
# token配置
|
||||||
token:
|
token:
|
||||||
@ -113,19 +112,12 @@ pagehelper:
|
|||||||
supportMethodsArguments: true
|
supportMethodsArguments: true
|
||||||
params: count=countSql
|
params: count=countSql
|
||||||
|
|
||||||
# Springdoc配置
|
# Swagger配置
|
||||||
springdoc:
|
swagger:
|
||||||
api-docs:
|
# 是否开启swagger
|
||||||
path: /v3/api-docs
|
enabled: true
|
||||||
swagger-ui:
|
# 请求前缀
|
||||||
enabled: true
|
pathMapping: /dev-api
|
||||||
path: /swagger-ui.html
|
|
||||||
tags-sorter: alpha
|
|
||||||
group-configs:
|
|
||||||
- group: 'default'
|
|
||||||
display-name: '测试模块'
|
|
||||||
paths-to-match: '/**'
|
|
||||||
packages-to-scan: com.ruoyi.web.controller.tool
|
|
||||||
|
|
||||||
# 防盗链配置
|
# 防盗链配置
|
||||||
referer:
|
referer:
|
||||||
|
|||||||
@ -109,8 +109,8 @@
|
|||||||
|
|
||||||
<!-- servlet包 -->
|
<!-- servlet包 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
<artifactId>jakarta.servlet-api</artifactId>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@ -56,7 +56,6 @@ public @interface Excel
|
|||||||
/**
|
/**
|
||||||
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -2,10 +2,10 @@ package com.ruoyi.common.core.domain.entity;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.validation.constraints.Email;
|
import javax.validation.constraints.Email;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.common.core.domain.entity;
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
package com.ruoyi.common.core.domain.entity;
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Pattern;
|
import javax.validation.constraints.Pattern;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
|||||||
@ -2,9 +2,9 @@ package com.ruoyi.common.core.domain.entity;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
package com.ruoyi.common.core.domain.entity;
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package com.ruoyi.common.core.domain.entity;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|||||||
@ -3,14 +3,14 @@ package com.ruoyi.common.filter;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.Filter;
|
import javax.servlet.Filter;
|
||||||
import jakarta.servlet.FilterChain;
|
import javax.servlet.FilterChain;
|
||||||
import jakarta.servlet.FilterConfig;
|
import javax.servlet.FilterConfig;
|
||||||
import jakarta.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import jakarta.servlet.ServletRequest;
|
import javax.servlet.ServletRequest;
|
||||||
import jakarta.servlet.ServletResponse;
|
import javax.servlet.ServletResponse;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 防盗链过滤器
|
* 防盗链过滤器
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
package com.ruoyi.common.filter;
|
package com.ruoyi.common.filter;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import jakarta.servlet.Filter;
|
import javax.servlet.Filter;
|
||||||
import jakarta.servlet.FilterChain;
|
import javax.servlet.FilterChain;
|
||||||
import jakarta.servlet.FilterConfig;
|
import javax.servlet.FilterConfig;
|
||||||
import jakarta.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import jakarta.servlet.ServletRequest;
|
import javax.servlet.ServletRequest;
|
||||||
import jakarta.servlet.ServletResponse;
|
import javax.servlet.ServletResponse;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
|
||||||
|
|||||||
@ -4,11 +4,11 @@ import java.io.BufferedReader;
|
|||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import jakarta.servlet.ReadListener;
|
import javax.servlet.ReadListener;
|
||||||
import jakarta.servlet.ServletInputStream;
|
import javax.servlet.ServletInputStream;
|
||||||
import jakarta.servlet.ServletResponse;
|
import javax.servlet.ServletResponse;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletRequestWrapper;
|
import javax.servlet.http.HttpServletRequestWrapper;
|
||||||
import com.ruoyi.common.utils.http.HttpHelper;
|
import com.ruoyi.common.utils.http.HttpHelper;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
|
|
||||||
|
|||||||
@ -3,14 +3,14 @@ package com.ruoyi.common.filter;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.Filter;
|
import javax.servlet.Filter;
|
||||||
import jakarta.servlet.FilterChain;
|
import javax.servlet.FilterChain;
|
||||||
import jakarta.servlet.FilterConfig;
|
import javax.servlet.FilterConfig;
|
||||||
import jakarta.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import jakarta.servlet.ServletRequest;
|
import javax.servlet.ServletRequest;
|
||||||
import jakarta.servlet.ServletResponse;
|
import javax.servlet.ServletResponse;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.enums.HttpMethod;
|
import com.ruoyi.common.enums.HttpMethod;
|
||||||
|
|
||||||
|
|||||||
@ -2,10 +2,10 @@ package com.ruoyi.common.filter;
|
|||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import jakarta.servlet.ReadListener;
|
import javax.servlet.ReadListener;
|
||||||
import jakarta.servlet.ServletInputStream;
|
import javax.servlet.ServletInputStream;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletRequestWrapper;
|
import javax.servlet.http.HttpServletRequestWrapper;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
|
|||||||
@ -16,7 +16,6 @@ import org.apache.commons.lang3.time.DateFormatUtils;
|
|||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||||
{
|
{
|
||||||
public static String YYYY = "yyyy";
|
public static String YYYY = "yyyy";
|
||||||
|
|||||||
@ -7,10 +7,10 @@ import java.net.URLEncoder;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import jakarta.servlet.ServletRequest;
|
import javax.servlet.ServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import jakarta.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
import org.springframework.web.context.request.RequestAttributes;
|
import org.springframework.web.context.request.RequestAttributes;
|
||||||
import org.springframework.web.context.request.RequestContextHolder;
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import com.ruoyi.common.core.text.StrFormatter;
|
|||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public class StringUtils extends org.apache.commons.lang3.StringUtils
|
public class StringUtils extends org.apache.commons.lang3.StringUtils
|
||||||
{
|
{
|
||||||
/** 空字符串 */
|
/** 空字符串 */
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
package com.ruoyi.common.utils.bean;
|
package com.ruoyi.common.utils.bean;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import jakarta.validation.ConstraintViolation;
|
import javax.validation.ConstraintViolation;
|
||||||
import jakarta.validation.ConstraintViolationException;
|
import javax.validation.ConstraintViolationException;
|
||||||
import jakarta.validation.Validator;
|
import javax.validation.Validator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bean对象属性验证
|
* bean对象属性验证
|
||||||
|
|||||||
@ -9,8 +9,8 @@ import java.io.OutputStream;
|
|||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import jakarta.servlet.ServletRequest;
|
import javax.servlet.ServletRequest;
|
||||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package com.ruoyi.common.utils.ip;
|
|||||||
|
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.commons.lang3.RegExUtils;
|
import org.apache.commons.lang3.RegExUtils;
|
||||||
import org.apache.commons.lang3.reflect.FieldUtils;
|
import org.apache.commons.lang3.reflect.FieldUtils;
|
||||||
@ -418,7 +418,7 @@ public class ExcelUtil<T>
|
|||||||
Object val = this.getCellValue(row, entry.getKey());
|
Object val = this.getCellValue(row, entry.getKey());
|
||||||
|
|
||||||
// 如果不存在实例则新建.
|
// 如果不存在实例则新建.
|
||||||
entity = (entity == null ? clazz.getDeclaredConstructor().newInstance() : entity);
|
entity = (entity == null ? clazz.newInstance() : entity);
|
||||||
// 从map中得到对应列的field.
|
// 从map中得到对应列的field.
|
||||||
Field field = (Field) entry.getValue()[0];
|
Field field = (Field) entry.getValue()[0];
|
||||||
Excel attr = (Excel) entry.getValue()[1];
|
Excel attr = (Excel) entry.getValue()[1];
|
||||||
@ -1124,8 +1124,7 @@ public class ExcelUtil<T>
|
|||||||
/**
|
/**
|
||||||
* 添加单元格
|
* 添加单元格
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
public Cell addCell(Excel attr, Row row, T vo, Field field, int column)
|
||||||
public Cell addCell(Excel attr, Row row, T vo, Field field, int column)
|
|
||||||
{
|
{
|
||||||
Cell cell = null;
|
Cell cell = null;
|
||||||
try
|
try
|
||||||
@ -1411,7 +1410,7 @@ public class ExcelUtil<T>
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object instance = excel.handler().getDeclaredConstructor().newInstance();
|
Object instance = excel.handler().newInstance();
|
||||||
Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class, Cell.class, Workbook.class });
|
Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class, Cell.class, Workbook.class });
|
||||||
value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb);
|
value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -310,7 +310,6 @@ public class ReflectUtils
|
|||||||
/**
|
/**
|
||||||
* 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
|
* 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public static void makeAccessible(Method method)
|
public static void makeAccessible(Method method)
|
||||||
{
|
{
|
||||||
if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers()))
|
if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers()))
|
||||||
@ -323,7 +322,6 @@ public class ReflectUtils
|
|||||||
/**
|
/**
|
||||||
* 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
|
* 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public static void makeAccessible(Field field)
|
public static void makeAccessible(Field field)
|
||||||
{
|
{
|
||||||
if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers())
|
if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers())
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.common.xss;
|
package com.ruoyi.common.xss;
|
||||||
|
|
||||||
import jakarta.validation.Constraint;
|
import javax.validation.Constraint;
|
||||||
import jakarta.validation.Payload;
|
import javax.validation.Payload;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
package com.ruoyi.common.xss;
|
package com.ruoyi.common.xss;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import jakarta.validation.ConstraintValidator;
|
import javax.validation.ConstraintValidator;
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
import javax.validation.ConstraintValidatorContext;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
<!-- 阿里数据库连接池 -->
|
<!-- 阿里数据库连接池 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 验证码 -->
|
<!-- 验证码 -->
|
||||||
|
|||||||
@ -2,8 +2,8 @@ package com.ruoyi.framework.aspectj;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.aspectj.lang.JoinPoint;
|
import org.aspectj.lang.JoinPoint;
|
||||||
import org.aspectj.lang.annotation.AfterReturning;
|
import org.aspectj.lang.annotation.AfterReturning;
|
||||||
|
|||||||
@ -3,6 +3,11 @@ package com.ruoyi.framework.config;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import javax.servlet.Filter;
|
||||||
|
import javax.servlet.FilterChain;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
@ -11,18 +16,13 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
import com.alibaba.druid.pool.DruidDataSource;
|
import com.alibaba.druid.pool.DruidDataSource;
|
||||||
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceBuilder;
|
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
|
||||||
import com.alibaba.druid.spring.boot3.autoconfigure.properties.DruidStatProperties;
|
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
||||||
import com.alibaba.druid.util.Utils;
|
import com.alibaba.druid.util.Utils;
|
||||||
import com.ruoyi.common.enums.DataSourceType;
|
import com.ruoyi.common.enums.DataSourceType;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
import com.ruoyi.framework.config.properties.DruidProperties;
|
import com.ruoyi.framework.config.properties.DruidProperties;
|
||||||
import com.ruoyi.framework.datasource.DynamicDataSource;
|
import com.ruoyi.framework.datasource.DynamicDataSource;
|
||||||
import jakarta.servlet.Filter;
|
|
||||||
import jakarta.servlet.FilterChain;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.ServletRequest;
|
|
||||||
import jakarta.servlet.ServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* druid 配置多数据源
|
* druid 配置多数据源
|
||||||
@ -96,7 +96,7 @@ public class DruidConfig
|
|||||||
Filter filter = new Filter()
|
Filter filter = new Filter()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void init(jakarta.servlet.FilterConfig filterConfig) throws ServletException
|
public void init(javax.servlet.FilterConfig filterConfig) throws ServletException
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package com.ruoyi.framework.config;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import jakarta.servlet.DispatcherType;
|
import javax.servlet.DispatcherType;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
|
|||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
public class RedisConfig extends CachingConfigurerSupport
|
public class RedisConfig extends CachingConfigurerSupport
|
||||||
|
|||||||
@ -5,10 +5,12 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
|
import org.springframework.security.authentication.ProviderManager;
|
||||||
|
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
|
||||||
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import org.springframework.security.web.SecurityFilterChain;
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||||
@ -28,6 +30,12 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
|
|||||||
@Configuration
|
@Configuration
|
||||||
public class SecurityConfig
|
public class SecurityConfig
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 自定义用户认证逻辑
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private UserDetailsService userDetailsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 认证失败处理类
|
* 认证失败处理类
|
||||||
*/
|
*/
|
||||||
@ -58,14 +66,17 @@ public class SecurityConfig
|
|||||||
@Autowired
|
@Autowired
|
||||||
private PermitAllUrlProperties permitAllUrl;
|
private PermitAllUrlProperties permitAllUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份验证实现
|
* 身份验证实现
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception
|
public AuthenticationManager authenticationManager()
|
||||||
{
|
{
|
||||||
return authenticationConfiguration.getAuthenticationManager();
|
DaoAuthenticationProvider daoAuthenticationProvider = new DaoAuthenticationProvider();
|
||||||
}
|
daoAuthenticationProvider.setUserDetailsService(userDetailsService);
|
||||||
|
daoAuthenticationProvider.setPasswordEncoder(bCryptPasswordEncoder());
|
||||||
|
return new ProviderManager(daoAuthenticationProvider);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* anyRequest | 匹配所有请求路径
|
* anyRequest | 匹配所有请求路径
|
||||||
@ -98,12 +109,12 @@ public class SecurityConfig
|
|||||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||||
// 注解标记允许匿名访问的url
|
// 注解标记允许匿名访问的url
|
||||||
.authorizeHttpRequests((requests) -> {
|
.authorizeHttpRequests((requests) -> {
|
||||||
permitAllUrl.getUrls().forEach(url -> requests.requestMatchers(url).permitAll());
|
permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
|
||||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||||
requests.requestMatchers("/login", "/register", "/captchaImage").permitAll()
|
requests.antMatchers("/login", "/register", "/captchaImage").permitAll()
|
||||||
// 静态资源,可匿名访问
|
// 静态资源,可匿名访问
|
||||||
.requestMatchers(HttpMethod.GET, "/", "/*.html", "/**.html", "/**.css", "/**.js", "/profile/**").permitAll()
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||||
.requestMatchers("/swagger-ui.html", "/v3/api-docs/**", "/swagger-ui/**", "/druid/**").permitAll()
|
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||||
// 除上面外的所有请求全部需要鉴权认证
|
// 除上面外的所有请求全部需要鉴权认证
|
||||||
.anyRequest().authenticated();
|
.anyRequest().authenticated();
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.ruoyi.framework.config;
|
package com.ruoyi.framework.config;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public class PermitAllUrlProperties implements InitializingBean, ApplicationCont
|
|||||||
@Override
|
@Override
|
||||||
public void afterPropertiesSet()
|
public void afterPropertiesSet()
|
||||||
{
|
{
|
||||||
RequestMappingHandlerMapping mapping = applicationContext.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class);
|
RequestMappingHandlerMapping mapping = applicationContext.getBean(RequestMappingHandlerMapping.class);
|
||||||
Map<RequestMappingInfo, HandlerMethod> map = mapping.getHandlerMethods();
|
Map<RequestMappingInfo, HandlerMethod> map = mapping.getHandlerMethods();
|
||||||
|
|
||||||
map.keySet().forEach(info -> {
|
map.keySet().forEach(info -> {
|
||||||
@ -45,12 +45,12 @@ public class PermitAllUrlProperties implements InitializingBean, ApplicationCont
|
|||||||
|
|
||||||
// 获取方法上边的注解 替代path variable 为 *
|
// 获取方法上边的注解 替代path variable 为 *
|
||||||
Anonymous method = AnnotationUtils.findAnnotation(handlerMethod.getMethod(), Anonymous.class);
|
Anonymous method = AnnotationUtils.findAnnotation(handlerMethod.getMethod(), Anonymous.class);
|
||||||
Optional.ofNullable(method).ifPresent(anonymous -> Objects.requireNonNull(info.getPathPatternsCondition().getPatternValues()) //
|
Optional.ofNullable(method).ifPresent(anonymous -> Objects.requireNonNull(info.getPatternsCondition().getPatterns())
|
||||||
.forEach(url -> urls.add(RegExUtils.replaceAll(url, PATTERN, ASTERISK))));
|
.forEach(url -> urls.add(RegExUtils.replaceAll(url, PATTERN, ASTERISK))));
|
||||||
|
|
||||||
// 获取类上边的注解, 替代path variable 为 *
|
// 获取类上边的注解, 替代path variable 为 *
|
||||||
Anonymous controller = AnnotationUtils.findAnnotation(handlerMethod.getBeanType(), Anonymous.class);
|
Anonymous controller = AnnotationUtils.findAnnotation(handlerMethod.getBeanType(), Anonymous.class);
|
||||||
Optional.ofNullable(controller).ifPresent(anonymous -> Objects.requireNonNull(info.getPathPatternsCondition().getPatternValues())
|
Optional.ofNullable(controller).ifPresent(anonymous -> Objects.requireNonNull(info.getPatternsCondition().getPatterns())
|
||||||
.forEach(url -> urls.add(RegExUtils.replaceAll(url, PATTERN, ASTERISK))));
|
.forEach(url -> urls.add(RegExUtils.replaceAll(url, PATTERN, ASTERISK))));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
package com.ruoyi.framework.interceptor;
|
package com.ruoyi.framework.interceptor;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.servlet.HandlerInterceptor;
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.ruoyi.framework.interceptor.impl;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.ruoyi.framework.manager;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import jakarta.annotation.PreDestroy;
|
import javax.annotation.PreDestroy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确保应用退出时能关闭后台线程
|
* 确保应用退出时能关闭后台线程
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package com.ruoyi.framework.security.filter;
|
package com.ruoyi.framework.security.filter;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import jakarta.servlet.FilterChain;
|
import javax.servlet.FilterChain;
|
||||||
import jakarta.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
|||||||
@ -2,8 +2,8 @@ package com.ruoyi.framework.security.handle;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.security.core.AuthenticationException;
|
import org.springframework.security.core.AuthenticationException;
|
||||||
import org.springframework.security.web.AuthenticationEntryPoint;
|
import org.springframework.security.web.AuthenticationEntryPoint;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
package com.ruoyi.framework.security.handle;
|
package com.ruoyi.framework.security.handle;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import jakarta.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.ruoyi.framework.web.exception;
|
package com.ruoyi.framework.web.exception;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.ruoyi.framework.web.service;
|
package com.ruoyi.framework.web.service;
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
import org.springframework.security.authentication.BadCredentialsException;
|
import org.springframework.security.authentication.BadCredentialsException;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.ruoyi.framework.web.service;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
<!-- 阿里数据库连接池 -->
|
<!-- 阿里数据库连接池 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
package com.ruoyi.generator.domain;
|
package com.ruoyi.generator.domain;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import com.ruoyi.common.constant.GenConstants;
|
import com.ruoyi.common.constant.GenConstants;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.ruoyi.generator.domain;
|
package com.ruoyi.generator.domain;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package ${packageName}.controller;
|
package ${packageName}.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|||||||
@ -21,6 +21,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.quartz-scheduler</groupId>
|
<groupId>org.quartz-scheduler</groupId>
|
||||||
<artifactId>quartz</artifactId>
|
<artifactId>quartz</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.mchange</groupId>
|
||||||
|
<artifactId>c3p0</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 通用工具-->
|
<!-- 通用工具-->
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.quartz.controller;
|
package com.ruoyi.quartz.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.quartz.SchedulerException;
|
import org.quartz.SchedulerException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.quartz.controller;
|
package com.ruoyi.quartz.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
package com.ruoyi.quartz.domain;
|
package com.ruoyi.quartz.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.quartz.service.impl;
|
package com.ruoyi.quartz.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import org.quartz.JobDataMap;
|
import org.quartz.JobDataMap;
|
||||||
import org.quartz.JobKey;
|
import org.quartz.JobKey;
|
||||||
import org.quartz.Scheduler;
|
import org.quartz.Scheduler;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package com.ruoyi.system.service.impl;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.common.annotation.DataSource;
|
import com.ruoyi.common.annotation.DataSource;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import java.util.Comparator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import jakarta.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import jakarta.validation.Validator;
|
import javax.validation.Validator;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|||||||
@ -130,10 +130,12 @@
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* horizontal el menu */
|
/* el menu */
|
||||||
.el-menu--horizontal .el-menu-item .svg-icon + span,
|
.el-menu-item,
|
||||||
.el-menu--horizontal .el-submenu__title .svg-icon + span {
|
.el-sub-menu {
|
||||||
margin-left: 3px;
|
.svg-icon + span {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu--horizontal .el-menu--popup {
|
.el-menu--horizontal .el-menu--popup {
|
||||||
|
|||||||
@ -116,20 +116,18 @@
|
|||||||
margin-left: 54px;
|
margin-left: 54px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu:not(.el-menu--horizontal) {
|
.submenu-title-noDropdown {
|
||||||
.submenu-title-noDropdown {
|
padding: 0 !important;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.el-tooltip {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.el-tooltip {
|
.svg-icon {
|
||||||
padding: 0 !important;
|
margin-left: 20px;
|
||||||
|
|
||||||
.svg-icon {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-submenu {
|
.el-submenu {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|||||||
@ -1,170 +1,170 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-color-picker
|
<el-color-picker
|
||||||
v-model="theme"
|
v-model="theme"
|
||||||
:predefine="['#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#f5222d', ]"
|
:predefine="['#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#f5222d', ]"
|
||||||
class="theme-picker"
|
class="theme-picker"
|
||||||
popper-class="theme-picker-dropdown"
|
popper-class="theme-picker-dropdown"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const ORIGINAL_THEME = '#409EFF' // default color
|
const ORIGINAL_THEME = '#409EFF' // default color
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chalk: '', // content of theme-chalk css
|
chalk: '', // content of theme-chalk css
|
||||||
theme: ''
|
theme: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
defaultTheme() {
|
defaultTheme() {
|
||||||
return this.$store.state.settings.theme
|
return this.$store.state.settings.theme
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
defaultTheme: {
|
defaultTheme: {
|
||||||
handler: function(val, oldVal) {
|
handler: function(val, oldVal) {
|
||||||
this.theme = val
|
this.theme = val
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
},
|
},
|
||||||
async theme(val) {
|
async theme(val) {
|
||||||
await this.setTheme(val)
|
await this.setTheme(val)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if(this.defaultTheme !== ORIGINAL_THEME) {
|
if(this.defaultTheme !== ORIGINAL_THEME) {
|
||||||
this.setTheme(this.defaultTheme)
|
this.setTheme(this.defaultTheme)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async setTheme(val) {
|
async setTheme(val) {
|
||||||
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
|
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
|
||||||
if (typeof val !== 'string') return
|
if (typeof val !== 'string') return
|
||||||
const themeCluster = this.getThemeCluster(val.replace('#', ''))
|
const themeCluster = this.getThemeCluster(val.replace('#', ''))
|
||||||
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
|
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
|
||||||
|
|
||||||
const getHandler = (variable, id) => {
|
const getHandler = (variable, id) => {
|
||||||
return () => {
|
return () => {
|
||||||
const originalCluster = this.getThemeCluster(ORIGINAL_THEME.replace('#', ''))
|
const originalCluster = this.getThemeCluster(ORIGINAL_THEME.replace('#', ''))
|
||||||
const newStyle = this.updateStyle(this[variable], originalCluster, themeCluster)
|
const newStyle = this.updateStyle(this[variable], originalCluster, themeCluster)
|
||||||
|
|
||||||
let styleTag = document.getElementById(id)
|
let styleTag = document.getElementById(id)
|
||||||
if (!styleTag) {
|
if (!styleTag) {
|
||||||
styleTag = document.createElement('style')
|
styleTag = document.createElement('style')
|
||||||
styleTag.setAttribute('id', id)
|
styleTag.setAttribute('id', id)
|
||||||
document.head.appendChild(styleTag)
|
document.head.appendChild(styleTag)
|
||||||
}
|
}
|
||||||
styleTag.innerText = newStyle
|
styleTag.innerText = newStyle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.chalk) {
|
if (!this.chalk) {
|
||||||
const url = `/styles/theme-chalk/index.css`
|
const url = `/styles/theme-chalk/index.css`
|
||||||
await this.getCSSString(url, 'chalk')
|
await this.getCSSString(url, 'chalk')
|
||||||
}
|
}
|
||||||
|
|
||||||
const chalkHandler = getHandler('chalk', 'chalk-style')
|
const chalkHandler = getHandler('chalk', 'chalk-style')
|
||||||
chalkHandler()
|
chalkHandler()
|
||||||
|
|
||||||
const styles = [].slice.call(document.querySelectorAll('style'))
|
const styles = [].slice.call(document.querySelectorAll('style'))
|
||||||
.filter(style => {
|
.filter(style => {
|
||||||
const text = style.innerText
|
const text = style.innerText
|
||||||
return new RegExp(oldVal, 'i').test(text) && !/Chalk Variables/.test(text)
|
return new RegExp(oldVal, 'i').test(text) && !/Chalk Variables/.test(text)
|
||||||
})
|
})
|
||||||
styles.forEach(style => {
|
styles.forEach(style => {
|
||||||
const { innerText } = style
|
const { innerText } = style
|
||||||
if (typeof innerText !== 'string') return
|
if (typeof innerText !== 'string') return
|
||||||
style.innerText = this.updateStyle(innerText, originalCluster, themeCluster)
|
style.innerText = this.updateStyle(innerText, originalCluster, themeCluster)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.$emit('change', val)
|
this.$emit('change', val)
|
||||||
},
|
},
|
||||||
|
|
||||||
updateStyle(style, oldCluster, newCluster) {
|
updateStyle(style, oldCluster, newCluster) {
|
||||||
let newStyle = style
|
let newStyle = style
|
||||||
oldCluster.forEach((color, index) => {
|
oldCluster.forEach((color, index) => {
|
||||||
newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index])
|
newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index])
|
||||||
})
|
})
|
||||||
return newStyle
|
return newStyle
|
||||||
},
|
},
|
||||||
|
|
||||||
getCSSString(url, variable) {
|
getCSSString(url, variable) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const xhr = new XMLHttpRequest()
|
const xhr = new XMLHttpRequest()
|
||||||
xhr.onreadystatechange = () => {
|
xhr.onreadystatechange = () => {
|
||||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||||
this[variable] = xhr.responseText.replace(/@font-face{[^}]+}/, '')
|
this[variable] = xhr.responseText.replace(/@font-face{[^}]+}/, '')
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xhr.open('GET', url)
|
xhr.open('GET', url)
|
||||||
xhr.send()
|
xhr.send()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getThemeCluster(theme) {
|
getThemeCluster(theme) {
|
||||||
const tintColor = (color, tint) => {
|
const tintColor = (color, tint) => {
|
||||||
let red = parseInt(color.slice(0, 2), 16)
|
let red = parseInt(color.slice(0, 2), 16)
|
||||||
let green = parseInt(color.slice(2, 4), 16)
|
let green = parseInt(color.slice(2, 4), 16)
|
||||||
let blue = parseInt(color.slice(4, 6), 16)
|
let blue = parseInt(color.slice(4, 6), 16)
|
||||||
|
|
||||||
if (tint === 0) { // when primary color is in its rgb space
|
if (tint === 0) { // when primary color is in its rgb space
|
||||||
return [red, green, blue].join(',')
|
return [red, green, blue].join(',')
|
||||||
} else {
|
} else {
|
||||||
red += Math.round(tint * (255 - red))
|
red += Math.round(tint * (255 - red))
|
||||||
green += Math.round(tint * (255 - green))
|
green += Math.round(tint * (255 - green))
|
||||||
blue += Math.round(tint * (255 - blue))
|
blue += Math.round(tint * (255 - blue))
|
||||||
|
|
||||||
red = red.toString(16)
|
red = red.toString(16)
|
||||||
green = green.toString(16)
|
green = green.toString(16)
|
||||||
blue = blue.toString(16)
|
blue = blue.toString(16)
|
||||||
|
|
||||||
return `#${red}${green}${blue}`
|
return `#${red}${green}${blue}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const shadeColor = (color, shade) => {
|
const shadeColor = (color, shade) => {
|
||||||
let red = parseInt(color.slice(0, 2), 16)
|
let red = parseInt(color.slice(0, 2), 16)
|
||||||
let green = parseInt(color.slice(2, 4), 16)
|
let green = parseInt(color.slice(2, 4), 16)
|
||||||
let blue = parseInt(color.slice(4, 6), 16)
|
let blue = parseInt(color.slice(4, 6), 16)
|
||||||
|
|
||||||
red = Math.round((1 - shade) * red)
|
red = Math.round((1 - shade) * red)
|
||||||
green = Math.round((1 - shade) * green)
|
green = Math.round((1 - shade) * green)
|
||||||
blue = Math.round((1 - shade) * blue)
|
blue = Math.round((1 - shade) * blue)
|
||||||
|
|
||||||
red = red.toString(16)
|
red = red.toString(16)
|
||||||
green = green.toString(16)
|
green = green.toString(16)
|
||||||
blue = blue.toString(16)
|
blue = blue.toString(16)
|
||||||
|
|
||||||
return `#${red}${green}${blue}`
|
return `#${red}${green}${blue}`
|
||||||
}
|
}
|
||||||
|
|
||||||
const clusters = [theme]
|
const clusters = [theme]
|
||||||
for (let i = 0; i <= 9; i++) {
|
for (let i = 0; i <= 9; i++) {
|
||||||
clusters.push(tintColor(theme, Number((i / 10).toFixed(2))))
|
clusters.push(tintColor(theme, Number((i / 10).toFixed(2))))
|
||||||
}
|
}
|
||||||
clusters.push(shadeColor(theme, 0.1))
|
clusters.push(shadeColor(theme, 0.1))
|
||||||
return clusters
|
return clusters
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.theme-message,
|
.theme-message,
|
||||||
.theme-picker-dropdown {
|
.theme-picker-dropdown {
|
||||||
z-index: 99999 !important;
|
z-index: 99999 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-picker .el-color-picker__trigger {
|
.theme-picker .el-color-picker__trigger {
|
||||||
height: 26px !important;
|
height: 26px !important;
|
||||||
width: 26px !important;
|
width: 26px !important;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-picker-dropdown .el-color-dropdown__link-btn {
|
.theme-picker-dropdown .el-color-dropdown__link-btn {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -60,22 +60,36 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
/* menu item */
|
.topbar-menu.el-menu--horizontal > .el-menu-item {
|
||||||
.topbar-menu.el-menu--horizontal .el-submenu__title, .topbar-menu.el-menu--horizontal .el-menu-item {
|
float: left;
|
||||||
padding: 0 10px !important;
|
height: 50px !important;
|
||||||
|
line-height: 50px !important;
|
||||||
|
color: #303133 !important;
|
||||||
|
padding: 0 5px !important;
|
||||||
|
margin: 0 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu--horizontal .el-menu--popup .el-menu-item:hover {
|
.el-menu-item.is-active .svg-icon + span, .el-submenu.is-active .svg-icon + span{
|
||||||
background-color: #f5f7fa !important;
|
color: v-bind(theme);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-menu--horizontal .el-menu .el-menu-item, .el-menu--horizontal .el-menu .el-submenu__title {
|
||||||
|
color: #303133 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* submenu item */
|
/* submenu item */
|
||||||
.topbar-menu.el-menu--horizontal > .el-submenu .el-submenu__title {
|
.topbar-menu.el-menu--horizontal > .el-submenu .el-submenu__title {
|
||||||
float: left;
|
float: left;
|
||||||
height: 47px !important;
|
height: 50px !important;
|
||||||
line-height: 50px !important;
|
line-height: 50px !important;
|
||||||
color: #303133;
|
color: #303133 !important;
|
||||||
margin: 0 15px !important;
|
padding: 0 5px !important;
|
||||||
|
margin: 0 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 图标右间距 */
|
||||||
|
.topbar-menu .svg-icon {
|
||||||
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* topbar more arrow */
|
/* topbar more arrow */
|
||||||
@ -89,10 +103,6 @@ export default {
|
|||||||
/* menu__title el-menu-item */
|
/* menu__title el-menu-item */
|
||||||
.topbar-menu.el-menu--horizontal .el-submenu__title, .topbar-menu.el-menu--horizontal .el-menu-item {
|
.topbar-menu.el-menu--horizontal .el-submenu__title, .topbar-menu.el-menu--horizontal .el-menu-item {
|
||||||
height: 55px;
|
height: 55px;
|
||||||
}
|
padding: 0 15px;
|
||||||
|
|
||||||
.el-menu--horizontal .el-menu .el-menu-item, .el-menu--horizontal .el-menu .el-submenu__title{
|
|
||||||
color: #303133;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
296
ruoyi-ui/src/views/monitor/cache/index.vue
vendored
296
ruoyi-ui/src/views/monitor/cache/index.vue
vendored
@ -1,148 +1,148 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="24" class="card-box">
|
<el-col :span="24" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header"><span><i class="el-icon-monitor"></i> 基本信息</span></div>
|
<div slot="header"><span><i class="el-icon-monitor"></i> 基本信息</span></div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<table cellspacing="0" style="width: 100%">
|
<table cellspacing="0" style="width: 100%">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">Redis版本</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">Redis版本</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_version }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_version }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">运行模式</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">运行模式</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_mode == "standalone" ? "单机" : "集群" }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_mode == "standalone" ? "单机" : "集群" }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">端口</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">端口</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.tcp_port }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.tcp_port }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">客户端数</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">客户端数</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.connected_clients }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.connected_clients }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">运行时间(天)</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">运行时间(天)</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.uptime_in_days }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.uptime_in_days }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">使用内存</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">使用内存</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.used_memory_human }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.used_memory_human }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">使用CPU</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">使用CPU</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ parseFloat(cache.info.used_cpu_user_children).toFixed(2) }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ parseFloat(cache.info.used_cpu_user_children).toFixed(2) }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">内存配置</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">内存配置</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.maxmemory_human }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.maxmemory_human }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">AOF是否开启</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">AOF是否开启</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.aof_enabled == "0" ? "否" : "是" }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.aof_enabled == "0" ? "否" : "是" }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">RDB是否成功</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">RDB是否成功</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.rdb_last_bgsave_status }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.rdb_last_bgsave_status }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">Key数量</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">Key数量</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.dbSize">{{ cache.dbSize }} </div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.dbSize">{{ cache.dbSize }} </div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">网络入口/出口</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">网络入口/出口</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.instantaneous_input_kbps }}kps/{{cache.info.instantaneous_output_kbps}}kps</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.instantaneous_input_kbps }}kps/{{cache.info.instantaneous_output_kbps}}kps</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12" class="card-box">
|
<el-col :span="12" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header"><span><i class="el-icon-pie-chart"></i> 命令统计</span></div>
|
<div slot="header"><span><i class="el-icon-pie-chart"></i> 命令统计</span></div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<div ref="commandstats" style="height: 420px" />
|
<div ref="commandstats" style="height: 420px" />
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12" class="card-box">
|
<el-col :span="12" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header"><span><i class="el-icon-odometer"></i> 内存信息</span></div>
|
<div slot="header"><span><i class="el-icon-odometer"></i> 内存信息</span></div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<div ref="usedmemory" style="height: 420px" />
|
<div ref="usedmemory" style="height: 420px" />
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getCache } from "@/api/monitor/cache"
|
import { getCache } from "@/api/monitor/cache"
|
||||||
import * as echarts from "echarts"
|
import * as echarts from "echarts"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Cache",
|
name: "Cache",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 统计命令信息
|
// 统计命令信息
|
||||||
commandstats: null,
|
commandstats: null,
|
||||||
// 使用内存
|
// 使用内存
|
||||||
usedmemory: null,
|
usedmemory: null,
|
||||||
// cache信息
|
// cache信息
|
||||||
cache: []
|
cache: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.openLoading()
|
this.openLoading()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查缓存询信息 */
|
/** 查缓存询信息 */
|
||||||
getList() {
|
getList() {
|
||||||
getCache().then((response) => {
|
getCache().then((response) => {
|
||||||
this.cache = response.data
|
this.cache = response.data
|
||||||
this.$modal.closeLoading()
|
this.$modal.closeLoading()
|
||||||
|
|
||||||
this.commandstats = echarts.init(this.$refs.commandstats, "macarons")
|
this.commandstats = echarts.init(this.$refs.commandstats, "macarons")
|
||||||
this.commandstats.setOption({
|
this.commandstats.setOption({
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "item",
|
trigger: "item",
|
||||||
formatter: "{a} <br/>{b} : {c} ({d}%)",
|
formatter: "{a} <br/>{b} : {c} ({d}%)",
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "命令",
|
name: "命令",
|
||||||
type: "pie",
|
type: "pie",
|
||||||
roseType: "radius",
|
roseType: "radius",
|
||||||
radius: [15, 95],
|
radius: [15, 95],
|
||||||
center: ["50%", "38%"],
|
center: ["50%", "38%"],
|
||||||
data: response.data.commandStats,
|
data: response.data.commandStats,
|
||||||
animationEasing: "cubicInOut",
|
animationEasing: "cubicInOut",
|
||||||
animationDuration: 1000,
|
animationDuration: 1000,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
this.usedmemory = echarts.init(this.$refs.usedmemory, "macarons")
|
this.usedmemory = echarts.init(this.$refs.usedmemory, "macarons")
|
||||||
this.usedmemory.setOption({
|
this.usedmemory.setOption({
|
||||||
tooltip: {
|
tooltip: {
|
||||||
formatter: "{b} <br/>{a} : " + this.cache.info.used_memory_human,
|
formatter: "{b} <br/>{a} : " + this.cache.info.used_memory_human,
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "峰值",
|
name: "峰值",
|
||||||
type: "gauge",
|
type: "gauge",
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 1000,
|
max: 1000,
|
||||||
detail: {
|
detail: {
|
||||||
formatter: this.cache.info.used_memory_human,
|
formatter: this.cache.info.used_memory_human,
|
||||||
},
|
},
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
value: parseFloat(this.cache.info.used_memory_human),
|
value: parseFloat(this.cache.info.used_memory_human),
|
||||||
name: "内存消耗",
|
name: "内存消耗",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
window.addEventListener("resize", () => {
|
window.addEventListener("resize", () => {
|
||||||
this.commandstats.resize()
|
this.commandstats.resize()
|
||||||
this.usedmemory.resize()
|
this.usedmemory.resize()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 打开加载层
|
// 打开加载层
|
||||||
openLoading() {
|
openLoading() {
|
||||||
this.$modal.loading("正在加载缓存监控数据,请稍候!")
|
this.$modal.loading("正在加载缓存监控数据,请稍候!")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,207 +1,207 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="12" class="card-box">
|
<el-col :span="12" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header"><span><i class="el-icon-cpu"></i> CPU</span></div>
|
<div slot="header"><span><i class="el-icon-cpu"></i> CPU</span></div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<table cellspacing="0" style="width: 100%;">
|
<table cellspacing="0" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="el-table__cell is-leaf"><div class="cell">属性</div></th>
|
<th class="el-table__cell is-leaf"><div class="cell">属性</div></th>
|
||||||
<th class="el-table__cell is-leaf"><div class="cell">值</div></th>
|
<th class="el-table__cell is-leaf"><div class="cell">值</div></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">核心数</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">核心数</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.cpuNum }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.cpuNum }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">用户使用率</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">用户使用率</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.used }}%</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.used }}%</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">系统使用率</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">系统使用率</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.sys }}%</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.sys }}%</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">当前空闲率</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">当前空闲率</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.free }}%</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.free }}%</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12" class="card-box">
|
<el-col :span="12" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header"><span><i class="el-icon-tickets"></i> 内存</span></div>
|
<div slot="header"><span><i class="el-icon-tickets"></i> 内存</span></div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<table cellspacing="0" style="width: 100%;">
|
<table cellspacing="0" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="el-table__cell is-leaf"><div class="cell">属性</div></th>
|
<th class="el-table__cell is-leaf"><div class="cell">属性</div></th>
|
||||||
<th class="el-table__cell is-leaf"><div class="cell">内存</div></th>
|
<th class="el-table__cell is-leaf"><div class="cell">内存</div></th>
|
||||||
<th class="el-table__cell is-leaf"><div class="cell">JVM</div></th>
|
<th class="el-table__cell is-leaf"><div class="cell">JVM</div></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">总内存</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">总内存</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.total }}G</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.total }}G</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.total }}M</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.total }}M</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">已用内存</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">已用内存</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.used}}G</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.used}}G</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.used}}M</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.used}}M</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">剩余内存</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">剩余内存</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.free }}G</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.free }}G</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.free }}M</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.free }}M</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">使用率</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">使用率</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem" :class="{'text-danger': server.mem.usage > 80}">{{ server.mem.usage }}%</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem" :class="{'text-danger': server.mem.usage > 80}">{{ server.mem.usage }}%</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm" :class="{'text-danger': server.jvm.usage > 80}">{{ server.jvm.usage }}%</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm" :class="{'text-danger': server.jvm.usage > 80}">{{ server.jvm.usage }}%</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24" class="card-box">
|
<el-col :span="24" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span><i class="el-icon-monitor"></i> 服务器信息</span>
|
<span><i class="el-icon-monitor"></i> 服务器信息</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<table cellspacing="0" style="width: 100%;">
|
<table cellspacing="0" style="width: 100%;">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">服务器名称</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">服务器名称</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerName }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerName }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">操作系统</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">操作系统</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osName }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osName }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">服务器IP</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">服务器IP</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerIp }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerIp }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">系统架构</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">系统架构</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osArch }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osArch }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24" class="card-box">
|
<el-col :span="24" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span><i class="el-icon-coffee-cup"></i> Java虚拟机信息</span>
|
<span><i class="el-icon-coffee-cup"></i> Java虚拟机信息</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<table cellspacing="0" style="width: 100%;table-layout:fixed;">
|
<table cellspacing="0" style="width: 100%;table-layout:fixed;">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">Java名称</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">Java名称</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.name }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.name }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">Java版本</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">Java版本</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.version }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.version }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">启动时间</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">启动时间</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.startTime }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.startTime }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">运行时长</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">运行时长</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.runTime }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.runTime }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">安装路径</div></td>
|
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">安装路径</div></td>
|
||||||
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.home }}</div></td>
|
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.home }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">项目路径</div></td>
|
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">项目路径</div></td>
|
||||||
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.userDir }}</div></td>
|
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.userDir }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">运行参数</div></td>
|
<td colspan="1" class="el-table__cell is-leaf"><div class="cell">运行参数</div></td>
|
||||||
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.inputArgs }}</div></td>
|
<td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.inputArgs }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24" class="card-box">
|
<el-col :span="24" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span><i class="el-icon-receiving"></i> 磁盘状态</span>
|
<span><i class="el-icon-receiving"></i> 磁盘状态</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<table cellspacing="0" style="width: 100%;">
|
<table cellspacing="0" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="el-table__cell el-table__cell is-leaf"><div class="cell">盘符路径</div></th>
|
<th class="el-table__cell el-table__cell is-leaf"><div class="cell">盘符路径</div></th>
|
||||||
<th class="el-table__cell is-leaf"><div class="cell">文件系统</div></th>
|
<th class="el-table__cell is-leaf"><div class="cell">文件系统</div></th>
|
||||||
<th class="el-table__cell is-leaf"><div class="cell">盘符类型</div></th>
|
<th class="el-table__cell is-leaf"><div class="cell">盘符类型</div></th>
|
||||||
<th class="el-table__cell is-leaf"><div class="cell">总大小</div></th>
|
<th class="el-table__cell is-leaf"><div class="cell">总大小</div></th>
|
||||||
<th class="el-table__cell is-leaf"><div class="cell">可用大小</div></th>
|
<th class="el-table__cell is-leaf"><div class="cell">可用大小</div></th>
|
||||||
<th class="el-table__cell is-leaf"><div class="cell">已用大小</div></th>
|
<th class="el-table__cell is-leaf"><div class="cell">已用大小</div></th>
|
||||||
<th class="el-table__cell is-leaf"><div class="cell">已用百分比</div></th>
|
<th class="el-table__cell is-leaf"><div class="cell">已用百分比</div></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody v-if="server.sysFiles">
|
<tbody v-if="server.sysFiles">
|
||||||
<tr v-for="(sysFile, index) in server.sysFiles" :key="index">
|
<tr v-for="(sysFile, index) in server.sysFiles" :key="index">
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.dirName }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.dirName }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.sysTypeName }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.sysTypeName }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.typeName }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.typeName }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.total }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.total }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.free }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.free }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.used }}</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.used }}</div></td>
|
||||||
<td class="el-table__cell is-leaf"><div class="cell" :class="{'text-danger': sysFile.usage > 80}">{{ sysFile.usage }}%</div></td>
|
<td class="el-table__cell is-leaf"><div class="cell" :class="{'text-danger': sysFile.usage > 80}">{{ sysFile.usage }}%</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getServer } from "@/api/monitor/server"
|
import { getServer } from "@/api/monitor/server"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Server",
|
name: "Server",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 服务器信息
|
// 服务器信息
|
||||||
server: []
|
server: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.openLoading()
|
this.openLoading()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询服务器信息 */
|
/** 查询服务器信息 */
|
||||||
getList() {
|
getList() {
|
||||||
getServer().then(response => {
|
getServer().then(response => {
|
||||||
this.server = response.data
|
this.server = response.data
|
||||||
this.$modal.closeLoading()
|
this.$modal.closeLoading()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 打开加载层
|
// 打开加载层
|
||||||
openLoading() {
|
openLoading() {
|
||||||
this.$modal.loading("正在加载服务监控数据,请稍候!")
|
this.$modal.loading("正在加载服务监控数据,请稍候!")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user