一般访问oss直接就下载了,但是有的时候需要在线预览的方式呈现给用户.所以以下代码在谷歌浏览器edge都已经测试过了.改一改就可以用.不多比比直接上代码
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController