切换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 org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,8 +40,7 @@ public class CosController {
|
|||||||
@ApiOperation(value = "获取cos临时密钥")
|
@ApiOperation(value = "获取cos临时密钥")
|
||||||
@GetMapping("/temp-key")
|
@GetMapping("/temp-key")
|
||||||
public R getTempKey() throws FileNotFoundException {
|
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();
|
return R.ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -20,8 +20,6 @@
|
|||||||
<module>play-admin</module>
|
<module>play-admin</module>
|
||||||
<module>play-common</module>
|
<module>play-common</module>
|
||||||
<module>play-generator</module>
|
<module>play-generator</module>
|
||||||
<module>play-oss</module>
|
|
||||||
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<!--定义相关属性,使用${属性名}的方式引用该属性-->
|
<!--定义相关属性,使用${属性名}的方式引用该属性-->
|
||||||
|
|||||||
Reference in New Issue
Block a user