Commit f870127e by jscat

nyx javaapp: update

1. 解决图片上传/tmp/目录不存在问题 (server->tomcat->basedir)
2. 解决http请求中文乱码导致的400错误问题
parent 24269642
...@@ -15,6 +15,8 @@ import org.springframework.stereotype.Controller; ...@@ -15,6 +15,8 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -61,7 +63,8 @@ public class CheckApiController { ...@@ -61,7 +63,8 @@ public class CheckApiController {
@RequestMapping(value = "/nyx/wx/check/text", method = RequestMethod.GET) @RequestMapping(value = "/nyx/wx/check/text", method = RequestMethod.GET)
public JSONResult checkText( public JSONResult checkText(
@RequestParam(value = "text", required = false, defaultValue = "0") String text @RequestParam(value = "text", required = false, defaultValue = "0") String text
) { ) throws UnsupportedEncodingException {
text = URLDecoder.decode(text,"UTF-8");
return checkService.Rockwell_checkServiceCheckText(text); return checkService.Rockwell_checkServiceCheckText(text);
} }
......
...@@ -2,6 +2,8 @@ server: ...@@ -2,6 +2,8 @@ server:
port: 8086 port: 8086
compression: compression:
enabled: true enabled: true
tomcat:
basedir: /usr/local/tmp
spring: spring:
profiles: profiles:
...@@ -22,8 +24,6 @@ spring: ...@@ -22,8 +24,6 @@ spring:
multipart: multipart:
max-file-size: 100MB max-file-size: 100MB
max-request-size: 1000MB max-request-size: 1000MB
tomcat:
basedir: /usr/local/tmp
logging: logging:
file: log/server.log file: log/server.log
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论