From 19c425805308d364c87e56601fd0deee1cda763e Mon Sep 17 00:00:00 2001 From: wenguang Date: Mon, 23 Mar 2020 14:38:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/inspectionProfiles/Project_Default.xml | 36 +++++++++++++++++++ src/main/java/com/we/config/WebMvcConfig.java | 1 + .../we/controller/PhotographController.java | 13 +++---- .../templates/fileoperation/multifile.html | 3 +- 4 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..6560a98 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,36 @@ + + + + \ No newline at end of file diff --git a/src/main/java/com/we/config/WebMvcConfig.java b/src/main/java/com/we/config/WebMvcConfig.java index e4bd343..71749d6 100644 --- a/src/main/java/com/we/config/WebMvcConfig.java +++ b/src/main/java/com/we/config/WebMvcConfig.java @@ -10,4 +10,5 @@ public class WebMvcConfig extends WebMvcConfigurationSupport { protected void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/"); } + } diff --git a/src/main/java/com/we/controller/PhotographController.java b/src/main/java/com/we/controller/PhotographController.java index 32fa146..de37d07 100644 --- a/src/main/java/com/we/controller/PhotographController.java +++ b/src/main/java/com/we/controller/PhotographController.java @@ -5,17 +5,10 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; import sun.misc.BASE64Decoder; -import sun.text.resources.FormatData; -import java.io.File; import java.io.FileOutputStream; -import java.io.IOException; import java.io.OutputStream; -import java.text.DateFormat; -import java.text.Format; -import java.util.Date; @Controller @RequestMapping("/photograph") @@ -37,7 +30,8 @@ public class PhotographController { @RequestMapping("/photoUpload") @ResponseBody public int fileUpload(@RequestParam("op") String op, @RequestParam("base64url") String base64url) { - if (!"takePhoto".equals(op)) { + String opStr = "takePhoto"; + if (!opStr.equals(op)) { return -1; } BASE64Decoder decoder = new BASE64Decoder(); @@ -46,7 +40,8 @@ public class PhotographController { // Base64解码 byte[] b = decoder.decodeBuffer(baseurl); for (int i = 0; i < b.length; ++i) { - if (b[i] < 0) {// 调整异常数据 + // 调整异常数据 + if (b[i] < 0) { b[i] += 256; } } diff --git a/src/main/resources/templates/fileoperation/multifile.html b/src/main/resources/templates/fileoperation/multifile.html index 694d887..a1a9579 100644 --- a/src/main/resources/templates/fileoperation/multifile.html +++ b/src/main/resources/templates/fileoperation/multifile.html @@ -1,6 +1,5 @@ - + Insert title here -- GitLab