切换OSS为阿里云OSS,文件上传成功,文件访问还有问题
This commit is contained in:
@@ -11,8 +11,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
/**
|
||||
@@ -42,8 +40,7 @@ public class CosController {
|
||||
@ApiOperation(value = "获取cos临时密钥")
|
||||
@GetMapping("/temp-key")
|
||||
public R getTempKey() throws FileNotFoundException {
|
||||
FileInputStream inputStream = new FileInputStream(new File("C:\\Users\\admin\\Pictures\\0001.jpg"));
|
||||
ossFileService.upload(inputStream, "test", "0001.png");
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user