Pre Merge pull request !440 from 玉青PLA/dev

pull/440/MERGE
玉青PLA 2025-11-30 13:09:13 +00:00 committed by Gitee
commit cf87119ed6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
27 changed files with 2050 additions and 1465 deletions

5
nacos/ruoyi-auth-dev.yml Normal file
View File

@ -0,0 +1,5 @@
spring:
data:
redis:
host: * # 替换自己的ip地址
port: 6379

View File

@ -0,0 +1,78 @@
spring:
data:
redis:
host: * # 替换自己的ip地址
port: 6379
cloud:
gateway:
discovery:
locator:
lowerCaseServiceId: true
enabled: true
routes:
# 认证中心
- id: ruoyi-auth
uri: lb://ruoyi-auth
predicates:
- Path=/auth/**
filters:
# 验证码处理
- CacheRequestBody
- ValidateCodeFilter
- StripPrefix=1
# 代码生成
- id: ruoyi-gen
uri: lb://ruoyi-gen
predicates:
- Path=/code/**
filters:
- StripPrefix=1
# 定时任务
- id: ruoyi-job
uri: lb://ruoyi-job
predicates:
- Path=/schedule/**
filters:
- StripPrefix=1
# 系统模块
- id: ruoyi-system
uri: lb://ruoyi-system
predicates:
- Path=/system/**
filters:
- StripPrefix=1
# 文件服务
- id: ruoyi-file
uri: lb://ruoyi-file
predicates:
- Path=/file/**
filters:
- StripPrefix=1
# 安全配置
security:
# 验证码
captcha:
enabled: true
type: math
# 防止XSS攻击
xss:
enabled: true
excludeUrls:
- /system/notice
# 不校验白名单
ignore:
whites:
- /auth/logout
- /auth/login
- /auth/register
- /*/v2/api-docs
- /*/v3/api-docs
- /csrf
# springdoc配置
springdoc:
webjars:
# 访问前缀
prefix:

48
nacos/ruoyi-gen-dev.yml Normal file
View File

@ -0,0 +1,48 @@
# spring配置
spring:
data:
redis:
host: * # 替换自己的ip地址
port: 6379
password:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://ip:port/ry_cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: * # 替换自己的密码
# mybatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.gen.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath:mapper/**/*.xml
# springdoc配置
springdoc:
gatewayUrl: http://localhost:8080/${spring.application.name}
api-docs:
# 是否开启接口文档
enabled: true
info:
# 标题
title: '代码生成接口文档'
# 描述
description: '代码生成接口描述'
# 作者信息
contact:
name: RuoYi
url: https://ruoyi.vip
# 代码生成
gen:
# 作者
author: ruoyi
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.ruoyi.system
# 自动去除表前缀默认是false
autoRemovePre: false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
tablePrefix: sys_
# 是否允许生成文件覆盖到本地(自定义路径),默认不允许
allowOverwrite: false

View File

@ -0,0 +1,66 @@
# spring配置
spring:
data:
redis:
host: * # 替换自己的ip地址
port: 6379
datasource:
druid:
stat-view-servlet:
enabled: true
loginUsername: ruoyi
loginPassword: 123456
dynamic:
druid:
initial-size: 5
min-idle: 5
maxActive: 20
maxWait: 60000
connectTimeout: 30000
socketTimeout: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
filters: stat,slf4j
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
# 主库数据源
master:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://ip:port/ry_cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: * # 替换自己的密码
# 从库数据源
# slave:
# username:
# password:
# url:
# driver-class-name:
# mybatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.system
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath:mapper/**/*.xml
# springdoc配置
springdoc:
gatewayUrl: http://localhost:8080/${spring.application.name}
api-docs:
# 是否开启接口文档
enabled: true
info:
# 标题
title: '系统模块接口文档'
# 描述
description: '系统模块接口描述'
# 作者信息
contact:
name: RuoYi
url: https://ruoyi.vip

View File

@ -14,12 +14,16 @@ spring:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
main:
web-application-type: reactive

View File

@ -1,6 +1,6 @@
# Tomcat
server:
port: 8080
port: 18080
# Spring
spring:
@ -14,27 +14,31 @@ spring:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
sentinel:
# 取消控制台懒加载
eager: true
transport:
# 控制台地址
dashboard: 127.0.0.1:8718
# nacos配置持久化
datasource:
ds1:
nacos:
server-addr: 127.0.0.1:8848
dataId: sentinel-ruoyi-gateway
groupId: DEFAULT_GROUP
data-type: json
rule-type: gw-flow
# sentinel:
# # 取消控制台懒加载
# eager: true
# transport:
# # 控制台地址
# dashboard: 127.0.0.1:8718
# # nacos配置持久化
# datasource:
# ds1:
# nacos:
# server-addr: 43.136.76.125:8848
# dataId: sentinel-ruoyi-gateway
# groupId: DEFAULT_GROUP
# data-type: json
# rule-type: gw-flow
main:
web-application-type: reactive

View File

@ -13,6 +13,7 @@
<module>ruoyi-gen</module>
<module>ruoyi-job</module>
<module>ruoyi-file</module>
<module>ruoyi-user</module>
</modules>
<artifactId>ruoyi-modules</artifactId>

View File

@ -3,6 +3,7 @@ package com.ruoyi.file.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
@ -24,6 +25,7 @@ public class SysFileController
private static final Logger log = LoggerFactory.getLogger(SysFileController.class);
@Autowired
@Qualifier("minioSysFileService")
private ISysFileService sysFileService;
/**

View File

@ -14,7 +14,7 @@ import com.ruoyi.file.utils.FileUploadUtils;
* @author ruoyi
*/
@Primary
@Service
@Service("localSysFileService")
public class LocalSysFileServiceImpl implements ISysFileService
{
/**

View File

@ -17,7 +17,7 @@ import io.minio.RemoveObjectArgs;
*
* @author ruoyi
*/
@Service
@Service("minioSysFileService")
public class MinioSysFileServiceImpl implements ISysFileService
{
@Autowired
@ -36,11 +36,30 @@ public class MinioSysFileServiceImpl implements ISysFileService
@Override
public String uploadFile(MultipartFile file) throws Exception
{
InputStream inputStream = null;
try
{
// InputStream inputStream = null;
// try
// {
// String fileName = FileUploadUtils.extractFilename(file);
// inputStream = file.getInputStream();
// PutObjectArgs args = PutObjectArgs.builder()
// .bucket(minioConfig.getBucketName())
// .object(fileName)
// .stream(inputStream, file.getSize(), -1)
// .contentType(file.getContentType())
// .build();
// client.putObject(args);
// return minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName;
// }
// catch (Exception e)
// {
// throw new RuntimeException("Minio Failed to upload file", e);
// }
// finally
// {
// IoUtils.closeQuietly(inputStream);
// }
String fileName = FileUploadUtils.extractFilename(file);
inputStream = file.getInputStream();
InputStream inputStream = file.getInputStream();
PutObjectArgs args = PutObjectArgs.builder()
.bucket(minioConfig.getBucketName())
.object(fileName)
@ -48,16 +67,8 @@ public class MinioSysFileServiceImpl implements ISysFileService
.contentType(file.getContentType())
.build();
client.putObject(args);
return minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName;
}
catch (Exception e)
{
throw new RuntimeException("Minio Failed to upload file", e);
}
finally
{
IoUtils.closeQuietly(inputStream);
}
return minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName;
}
/**

View File

@ -14,12 +14,16 @@ spring:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
main:
web-application-type: reactive

View File

@ -14,12 +14,16 @@ spring:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
main:
web-application-type: reactive

View File

@ -14,12 +14,16 @@ spring:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
main:
web-application-type: reactive

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-modules</artifactId>
<version>3.6.6</version>
</parent>
<artifactId>ruoyi-modules-user</artifactId>
<description>ruoyi-modules-user用户模块</description>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- SpringCloud Alibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
<!-- RuoYi Common DataSource -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-datasource</artifactId>
</dependency>
<!-- RuoYi Common DataScope -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-datascope</artifactId>
</dependency>
<!-- RuoYi Common Log -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-log</artifactId>
</dependency>
<!-- RuoYi Common Swagger -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-swagger</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,34 @@
package com.ruoyi.user;
import com.ruoyi.common.security.annotation.EnableCustomConfig;
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @Author
* @Email 13795144611@163.com
* @Version JDK17
* @date 2025/11/30 21:02
* @description
*/
@EnableCustomConfig
@EnableRyFeignClients
@SpringBootApplication
public class RuoYiUserApplication {
public static void main(String[] args)
{
SpringApplication.run(RuoYiUserApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 用户模块启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}

View File

@ -0,0 +1,10 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}
_ _
(_) | |
_ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___
| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \
| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | |
|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_|
__/ | __/ |
|___/ |___/

View File

@ -0,0 +1,29 @@
# Tomcat
server:
port: 9501
# Spring
spring:
application:
# 应用名称
name: ruoyi-user
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
config:
# 配置中心地址
server-addr: 43.136.76.125:8848
namespace: 1c8ac19f-8d7a-4008-a291-90b162b37fd5
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
main:
web-application-type: reactive

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/ruoyi-user" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.ruoyi" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
</configuration>

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 若依管理系统
VUE_APP_TITLE = 星海能源(大连)
# 开发环境配置
ENV = 'development'

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 若依管理系统
VUE_APP_TITLE = 星海能源(大连)
# 生产环境配置
ENV = 'production'

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 若依管理系统
VUE_APP_TITLE = 星海能源(大连)
BABEL_ENV = production

View File

@ -28,7 +28,7 @@
"axios": "0.28.1",
"clipboard": "2.0.8",
"core-js": "3.37.1",
"echarts": "5.4.0",
"echarts": "^5.4.0",
"element-ui": "2.15.14",
"file-saver": "2.0.5",
"fuse.js": "6.4.3",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 KiB

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">{{title}}</h3>
<el-form-item prop="username">
<el-form-item prop="username" label="账号">
<el-input
v-model="loginForm.username"
type="text"
@ -12,7 +12,7 @@
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-form-item prop="password" label="密码">
<el-input
v-model="loginForm.password"
type="password"
@ -23,12 +23,12 @@
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="captchaEnabled">
<el-form-item prop="code" v-if="captchaEnabled" label="验证码">
<el-input
v-model="loginForm.code"
auto-complete="off"
placeholder="验证码"
style="width: 63%"
style="width: 170px"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
@ -56,7 +56,7 @@
</el-form>
<!-- 底部 -->
<div class="el-login-footer">
<span>Copyright © 2018-2025 ruoyi.vip All Rights Reserved.</span>
<span>Copyright © 2024-2025 XingHai.Energy All Rights Reserved.</span>
</div>
</div>
</template>
@ -159,11 +159,15 @@ export default {
<style rel="stylesheet/scss" lang="scss">
.login {
display: flex;
justify-content: center;
justify-content: flex-end;
padding: 50px;
align-items: center;
height: 100%;
background-image: url("../assets/images/login-background.jpg");
background-size: cover;
position: relative;
min-width: 700px;
min-height: 700px;
}
.title {
margin: 0px auto 30px auto;

View File

@ -34,7 +34,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
target: `http://localhost:18080`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''