图片上传

This commit is contained in:
2023-04-28 10:16:19 +08:00
parent c5b056b5a4
commit ea9974862e
2 changed files with 19 additions and 3 deletions

View File

@@ -163,10 +163,16 @@ public class CommonController {
}
}
/**
* 上传到阿里云oss
* http://localhost:8080/common/uploadOSS
* @param file
* @return
* @throws Exception
*/
@CrossOrigin
@PostMapping("/uploadOSS")
public AjaxResult uploadFileOSS(MultipartFile file) throws Exception {
System.out.println(file);
try {
String url = AliyunOssUploadUtils.uploadFile(file);
AjaxResult ajax = AjaxResult.success();