Compare commits

..

No commits in common. "db5f285d5bbe46517d4682ebd897f3e7f8de99c5" and "ab145a49932a264633a35a789c143cf3a23f54c0" have entirely different histories.

4 changed files with 22 additions and 59 deletions

View File

@ -210,14 +210,14 @@ public class CommonController {
public void view(HttpServletRequest request, HttpServletResponse response) {
// ISO-8859-1 ==> UTF-8 进行编码转换
String imgPath = extractPathFromPattern(request);
if (oConvertUtils.isEmpty(imgPath) || CommonConstant.STRING_NULL.equals(imgPath)) {
if(oConvertUtils.isEmpty(imgPath) || CommonConstant.STRING_NULL.equals(imgPath)){
return;
}
// 其余处理略
InputStream inputStream = null;
OutputStream outputStream = null;
try {
imgPath = imgPath.replace("..", "").replace("../", "");
imgPath = imgPath.replace("..", "").replace("../","");
if (imgPath.endsWith(SymbolConstant.COMMA)) {
imgPath = imgPath.substring(0, imgPath.length() - 1);
}
@ -227,20 +227,15 @@ public class CommonController {
String filePath = uploadpath + File.separator + imgPath;
File file = new File(filePath);
if (!file.exists()) {
if(!file.exists()){
response.setStatus(404);
log.error("文件[" + imgPath + "]不存在..");
log.error("文件["+imgPath+"]不存在..");
return;
//throw new RuntimeException();
}
// 获取文件大小并设置Content-Length
long fileLength = file.length();
response.setHeader("Content-Length", String.valueOf(fileLength));
// 设置强制下载不打开
response.setContentType("application/force-download");
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"), "iso-8859-1"));
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1"));
inputStream = new BufferedInputStream(new FileInputStream(filePath));
outputStream = response.getOutputStream();
byte[] buf = new byte[1024];
@ -269,6 +264,7 @@ public class CommonController {
}
}
}
}
// /**

View File

@ -1,5 +1,5 @@
server:
port: 8082
port: 8080
tomcat:
max-swallow-size: -1
error:
@ -7,7 +7,7 @@ server:
include-stacktrace: ALWAYS
include-message: ALWAYS
servlet:
context-path: /nursing-unit-nacos
context-path: /nursing-unit
compression:
enabled: true
min-response-size: 1024
@ -20,12 +20,6 @@ management:
include: metrics,jeecghttptrace
spring:
application:
name: nursing-unit-nacos
cloud:
nacos:
discovery:
service-name: nursing-unit-nacos
# flyway配置
flyway:
# 是否启用flyway
@ -169,10 +163,10 @@ spring:
slow-sql-millis: 5000
datasource:
master:
url: jdbc:mysql://mysql8-prod:3306/nursing_unit?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://localhost:40521/nursing_unit?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
# url: jdbc:mysql://localhost:3306/nursing_unit_001?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: fw8864sshdang
password: uGDBkM25I6nZCNM2
username: root
password: BLXC@123.
driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置
#multi-datasource1:
@ -182,10 +176,10 @@ spring:
#driver-class-name: com.mysql.cj.jdbc.Driver
#redis 配置
redis:
database: 1
host: redis
database: 0
host: 127.0.0.1
port: 6379
password: uUgrUus4JAYuwxzo
password:
#mybatis plus 设置
mybatis-plus:
mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:com/nu/**/xml/*Mapper.xml
@ -231,9 +225,9 @@ jeecg:
app: http://localhost:8051
path:
#文件上传根目录 设置
upload: /opt/nu/upFiles
upload: /opt/upFiles
#webapp文件路径
webapp: /opt/nu/webapp
webapp: /opt/webapp
shiro:
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
#阿里云oss存储和大鱼短信秘钥配置

View File

@ -1,16 +0,0 @@
spring:
cloud:
nacos:
discovery:
server-addr: ${config.server-addr}
namespace: ${config.namespace}
group: ${config.group}
username: ${config.username}
password: ${config.password}
config:
server-addr: ${config.server-addr}
namespace: ${config.namespace}
group: ${config.group}
file-extension: yaml
username: ${config.username}
password: ${config.password}

21
pom.xml
View File

@ -150,17 +150,6 @@
<artifactId>commonmark</artifactId>
<version>${commonmark.version}</version>
</dependency>
<!-- Nacos 服务发现 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- Nacos 配置中心 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
@ -476,7 +465,7 @@
<id>dev</id>
<activation>
<!--默认激活配置-->
<activeByDefault>false</activeByDefault>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!--当前环境-->
@ -528,21 +517,21 @@
<id>uat</id>
<activation>
<!--默认激活配置-->
<activeByDefault>true</activeByDefault>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<!--当前环境-->
<profile.name>uat</profile.name>
<!--Nacos服务地址-->
<config.server-addr>121.36.88.64</config.server-addr>
<config.server-addr>jeecg-boot-nacos:8848</config.server-addr>
<!--Nacos配置中心命名空间,用于支持多环境.这里必须使用ID不能使用名称,默认为空-->
<config.namespace></config.namespace>
<!--Nacos配置分组名称-->
<config.group>DEFAULT_GROUP</config.group>
<!--Nacos用户名-->
<config.username>fw8864nasadn</config.username>
<config.username></config.username>
<!--Nacos密码-->
<config.password>JINisgIngV82G2</config.password>
<config.password></config.password>
</properties>
</profile>
<!-- 生产 -->