refactor(music-houduan): 重构文件上传功能并优化配置
- 更新 sa-token 版本至 1.43.0 - 重构文件上传功能,支持相对路径和绝对路径- 优化文件删除逻辑,处理多种路径情况 - 更新应用配置,使用相对路径 -调整 Redis 配置结构- 移除冗余代码,提高代码可读性
This commit is contained in:
@@ -1,25 +1,26 @@
|
||||
spring.application.name=music-houduan
|
||||
server.port=8085
|
||||
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/music_db?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=123456
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.show-sql=true
|
||||
|
||||
spring.data.redis.host=127.0.0.1
|
||||
spring.data.redis.port=6379
|
||||
spring.data.redis.password=123456
|
||||
|
||||
sa-token.token-name=satoken
|
||||
sa-token.timeout=2592000
|
||||
sa-token.is-concurrent=true
|
||||
sa-token.is-share=true
|
||||
sa-token.token-style=uuid
|
||||
|
||||
# 文件上传配置
|
||||
file.upload-path=C:/it/music-houduan/upload/
|
||||
file.access-path=/upload/
|
||||
file.allowed-types=jpg,jpeg,png,gif,mp3,wav,lrc,txt
|
||||
#spring.application.name=music-houduan
|
||||
#server.port=8085
|
||||
#
|
||||
#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/music_db?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
||||
#spring.datasource.username=root
|
||||
#spring.datasource.password=123456
|
||||
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
#
|
||||
#spring.jpa.hibernate.ddl-auto=update
|
||||
#spring.jpa.show-sql=true
|
||||
#
|
||||
#spring.data.redis.host=127.0.0.1
|
||||
#spring.data.redis.port=6379
|
||||
#spring.data.redis.password=123456
|
||||
#
|
||||
#sa-token.token-name=satoken
|
||||
#sa-token.timeout=2592000
|
||||
#sa-token.is-concurrent=true
|
||||
#sa-token.is-share=true
|
||||
#sa-token.token-style=uuid
|
||||
#
|
||||
## 文件上传配置
|
||||
#file.upload-path=./upload/
|
||||
#project.root-path=.
|
||||
#file.access-path=/upload/
|
||||
#file.allowed-types=jpg,jpeg,png,gif,mp3,wav,lrc,txt
|
||||
@@ -23,28 +23,27 @@ spring:
|
||||
connection-timeout: 30000
|
||||
|
||||
# JPA配置
|
||||
jpa:
|
||||
database-platform: org.hibernate.dialect.MySQL8Dialect
|
||||
hibernate:
|
||||
ddl-auto: update
|
||||
show-sql: false
|
||||
properties:
|
||||
hibernate:
|
||||
format_sql: false
|
||||
# jpa:
|
||||
# database-platform: org.hibernate.dialect.MySQL8Dialect
|
||||
# hibernate:
|
||||
# ddl-auto: update
|
||||
# show-sql: false
|
||||
# properties:
|
||||
# hibernate:
|
||||
# format_sql: false
|
||||
|
||||
# Redis配置
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: 123456
|
||||
database: 0
|
||||
timeout: 10000
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8
|
||||
max-wait: -1
|
||||
max-idle: 8
|
||||
min-idle: 0
|
||||
data:
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
password: 123456
|
||||
timeout: 10000
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8
|
||||
max-wait: -1
|
||||
max-idle: 8
|
||||
min-idle: 0
|
||||
|
||||
# 文件上传配置
|
||||
servlet:
|
||||
@@ -60,6 +59,7 @@ spring:
|
||||
serialization:
|
||||
write-dates-as-timestamps: false
|
||||
|
||||
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
# token名称 (同时也是cookie名称)
|
||||
@@ -88,7 +88,8 @@ sa-token:
|
||||
# 文件上传配置
|
||||
file:
|
||||
# 上传路径
|
||||
upload-path: upload/
|
||||
# upload-path: C:/it/music-houduan/
|
||||
upload-path: ${user.dir}/music-houduan/upload
|
||||
# 访问路径
|
||||
access-path: /upload/
|
||||
# 允许的文件类型
|
||||
|
||||
Reference in New Issue
Block a user