新增:新增上传头像 API,采用本地存储方式存储头像

This commit is contained in:
2023-01-05 22:32:23 +08:00
parent e77c77419b
commit 5252c54c48
54 changed files with 931 additions and 937 deletions

View File

@@ -73,6 +73,12 @@ spring:
security:
# 排除路径配置
excludes:
# 静态资源
- /*.html
- /**/*.html
- /**/*.css
- /**/*.js
- /webSocket/**
# 接口文档相关资源
- /favicon.ico
- /doc.html
@@ -80,6 +86,9 @@ security:
- /swagger-ui/**
- /swagger-resources/**
- /*/api-docs/**
# 本地存储资源
- /avatar/**
- /file/**
--- ### 非对称加密配置(例如:密码加密传输,前端公钥加密,后端私钥解密;在线生成 RSA 密钥对http://web.chacuo.net/netrsakeypair
rsa:
@@ -106,6 +115,39 @@ springdoc:
swagger-ui:
enabled: true
--- ### 文件上传配置
spring:
servlet:
multipart:
enabled: true
# 单文件上传大小限制
max-file-size: 10MB
# 单次总上传文件大小限制
max-request-size: 20MB
--- ### 本地存储配置
local-storage:
# 文件模式
filePattern: /file/**
# 头像模式
avatarPattern: /avatar/**
# 文件上传大小限制
maxSizeInMb: 10
# 头像上传大小限制
avatarMaxSizeInMb: 5
## Windows 系统本地存储配置
windows:
file: C:\continew-admin\data\file\
avatar: C:\continew-admin\data\avatar\
## Linux 系统本地存储配置
linux:
file: /data/file/
avatar: /data/avatar/
## Mac 系统本地存储配置
mac:
file: ~/data/file/
avatar: ~/data/avatar/
--- ### 跨域配置
cors:
# 配置允许跨域的域名

View File

@@ -69,6 +69,20 @@ spring:
# 是否开启 SSL
ssl: false
--- ### 安全配置
security:
# 排除路径配置
excludes:
# 静态资源
- /*.html
- /**/*.html
- /**/*.css
- /**/*.js
- /webSocket/**
# 本地存储资源
- /avatar/**
- /file/**
--- ### 非对称加密配置(例如:密码加密传输,前端公钥加密,后端私钥解密;在线生成 RSA 密钥对http://web.chacuo.net/netrsakeypair
rsa:
# 私钥
@@ -94,6 +108,39 @@ springdoc:
swagger-ui:
enabled: false
--- ### 文件上传配置
spring:
servlet:
multipart:
enabled: true
# 单文件上传大小限制
max-file-size: 10MB
# 单次总上传文件大小限制
max-request-size: 20MB
--- ### 本地存储配置
local-storage:
# 文件模式
filePattern: /file/**
# 头像模式
avatarPattern: /avatar/**
# 文件上传大小限制
maxSizeInMb: 10
# 头像上传大小限制
avatarMaxSizeInMb: 5
## Windows 系统本地存储配置
windows:
file: C:\continew-admin\data\file\
avatar: C:\continew-admin\data\avatar\
## Linux 系统本地存储配置
linux:
file: /data/file/
avatar: /data/avatar/
## Mac 系统本地存储配置
mac:
file: ~/data/file/
avatar: ~/data/avatar/
--- ### 跨域配置
cors:
# 配置允许跨域的域名

View File

@@ -92,17 +92,6 @@ sa-token:
# JWT秘钥
jwt-secret-key: asdasdasifhueuiwyurfewbfjsdafjk
--- ### 安全配置
security:
# 排除路径配置
excludes:
# 静态资源
- /*.html
- /**/*.html
- /**/*.css
- /**/*.js
- /webSocket/**
--- ### MyBatis Plus 配置
mybatis-plus:
# Mapper 接口扫描包配置(该配置为自定义配置,非 MP 配置,不支持多包,如有需要可通过注解配置或提升扫描包层级)