master
黄欣 5 years ago
parent 602f0ddd50
commit 2ea2957ea5

@ -183,29 +183,4 @@ public class CaseCategoryController {
return ajaxResult;
}
/**
* @CK
* filesfilediross
* @return
*/
@RequestMapping(value = "/upload-category-url", produces = "text/html;charset=UTF-8")
public String uploadCategoryUrl(MultipartFile file) {
Map<String, Object> value = new HashMap<>();
try {
if(file!=null){
//保存文件
String url = ossService.uploadCategoryUrl(file,filedir);
logger.debug("图片路径{}",url);
value.put("code", 2000);
value.put("msg", "图片上传成功");
value.put("url",url);
}
} catch (Exception e) {
e.printStackTrace();
value.put("code", 2001);
value.put("msg", "图片上传失败");
}
return JSONObject.toJSONString(value);
}
}

@ -213,13 +213,13 @@ public class CaseContentController {
* filesfilediross
* @return
*/
@RequestMapping(value = "/upload-content-url", produces = "text/html;charset=UTF-8")
public String uploadContentUrl(MultipartFile file) {
@RequestMapping(value = "/upload-file", produces = "text/html;charset=UTF-8")
public String uploadFile(MultipartFile file) {
Map<String, Object> value = new HashMap<>();
try {
if(file!=null){
//保存文件
String url = ossService.uploadCategoryUrl(file,filedir);
String url = ossService.uploadFile(file,filedir);
logger.debug("图片路径{}",url);
value.put("code", 2000);
value.put("msg", "图片上传成功");

@ -51,7 +51,7 @@ public class OssService {
return jsonObject;
}
public String uploadCategoryUrl(MultipartFile file, String filedir) throws Exception {
public String uploadFile(MultipartFile file, String filedir) throws Exception {
if (file == null || file.getSize() <= 0) {
throw new Exception("file不能为空");
}

Loading…
Cancel
Save