fix: 文件上传接口调整
This commit is contained in:
parent
f9b5a7abb3
commit
6d154f1f9a
@ -96,7 +96,8 @@ public class FileController {
|
||||
.body(new FileSystemResource(file));
|
||||
}
|
||||
|
||||
@PostMapping("/image")
|
||||
/** produces 显式 UTF-8,避免网关/客户端按 ISO-8859-1 解码导致 message 中文乱码 */
|
||||
@PostMapping(value = "/image", produces = MediaType.APPLICATION_JSON_VALUE + ";charset=UTF-8")
|
||||
public Map<String, Object> uploadImage(@RequestParam("file") MultipartFile file) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
|
||||
|
||||
@ -28,6 +28,10 @@ server:
|
||||
port: 8080
|
||||
servlet:
|
||||
context-path:
|
||||
encoding:
|
||||
charset: UTF-8
|
||||
enabled: true
|
||||
force: true
|
||||
# 与 multipart 一致,避免嵌入式 Tomcat 仍限制表单体积导致大视频 413
|
||||
tomcat:
|
||||
max-http-form-post-size: 200MB
|
||||
|
||||
Loading…
Reference in New Issue
Block a user