:bug:修复问题优化代码

This commit is contained in:
hello-hao
2022-03-17 13:42:57 +08:00
parent c754825b93
commit 2997d9ee72
5 changed files with 10 additions and 24 deletions
@@ -84,8 +84,7 @@ public class IndexController {
return msg;
}
@PostMapping(value = "/upload")//upimg new
@PostMapping(value = "/upload")// new
@ResponseBody
public Msg upimg(HttpServletRequest request,HttpSession httpSession
, @RequestParam(value = "file", required = false) MultipartFile multipartFile,Integer day) {
@@ -119,21 +118,16 @@ public class IndexController {
if(syscounts>=temp){
Msg msg = uploadServicel.uploadForLoc(request, null, setday, URLArr[i]);
if(!msg.getCode().equals("200")){
//失败的个数
errcounts++;
}else{
retArray.add(msg);
}
}else{
//超额的个数
excess++;
}
}
//共传过来的数量
jsonObject.put("counts",URLArr.length);
//上传失败的个数
jsonObject.put("errcounts",errcounts);
//超过系统定义值 不上传的数量
jsonObject.put("excess",excess);
jsonObject.put("urls",retArray);
retMsg.setData(jsonObject);
@@ -206,8 +200,6 @@ public class IndexController {
return msg;
}
@GetMapping("/verifyCode")
public void verifyCode(HttpServletRequest request, HttpServletResponse response,HttpSession httpSession) {
IVerifyCodeGen iVerifyCodeGen = new SimpleCharVerifyCodeGenImpl();