Commit 4d02a398 authored by kiritoausna's avatar kiritoausna

德兴

parent a3ad2701
......@@ -38,6 +38,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* File工具类,扩展 hutool 工具包
......@@ -207,6 +208,28 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
}
return null;
}
/**
* 返回 文件名部分
* @param multipartFiles
* @param picDirPath
* @return
* @throws IOException
*/
public static String savePicReturnFileName(MultipartFile multipartFiles, String picDirPath) throws IOException {
File dir = new File(picDirPath);
if (!dir.exists()){
dir.mkdir();
}
long currentTimeMillis = System.currentTimeMillis();
String originalFilename = multipartFiles.getOriginalFilename();
String suffxiName = originalFilename.substring(originalFilename.lastIndexOf("."));
String fileName = UUID.randomUUID().toString() + suffxiName;
String filePath = picDirPath + "/" + fileName;
File canonicalFile = new File(filePath).getCanonicalFile();
multipartFiles.transferTo(canonicalFile);
// Thumbnails.of(inputStream).scale(1d).outputQuality(0.5f).toFile(filePath);
return fileName.toString();
}
/**
* 导出excel
......
......@@ -5,7 +5,7 @@ spring:
connectionProperties: druid.stat.mergeSql=false;druid.stat.slowSqlMillis=5000
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3310}/${DB_NAME:zhonghe}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=true&requireSSL=true
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3310}/${DB_NAME:tsknew}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=true&requireSSL=true
username: ${DB_USER:root}
#password: ${DB_PWD:jinghe2021//}
password: ${DB_PWD:jinghe2023}
......@@ -54,7 +54,7 @@ spring:
# 登录相关配置
login:
# 登录缓存
cache-enable: true
cache-enable: false
# 是否限制单用户登录
single-login: false
# 验证码
......
server:
port: 9003
port: 9015
spring:
freemarker:
check-template-location: false
profiles:
active: prod
active: dev
jackson:
time-zone: GMT+8
data:
......@@ -28,9 +28,9 @@ spring:
redis:
#数据库索引
database: ${REDIS_DB:0}
host: ${REDIS_HOST:8.142.46.126}
host: ${REDIS_HOST:192.168.2.16}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
password: ${REDIS_PWD:123456}
#连接超时时间
timeout: 5000
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment