zhangjinli 3 years ago
parent 8a3a1d4cac
commit 04f093e7c7

@ -106,7 +106,7 @@ public class UtilsController {
@ResponseBody
public JSONObject upload2(@RequestParam("file") MultipartFile file, @RequestParam(required = false) String name) {
JSONObject res = new JSONObject();
res.put("errno",0);
res.put("errno",1);
if (file.isEmpty()) {
res.put("message","请选择文件");
return res;
@ -119,7 +119,7 @@ public class UtilsController {
}
try {
file.transferTo(dest);
res.replace("errno",1);
res.replace("errno",0);
JSONObject obj = new JSONObject();
obj.put("alt", fileName);
obj.put("url", "/upload/" + newFileName);

Loading…
Cancel
Save