修改静态资源下载问题
This commit is contained in:
parent
86e83a527c
commit
4dda3065aa
@ -8,8 +8,8 @@ import org.springframework.web.bind.annotation.PathVariable;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: BaiduMapStaticController
|
* @ClassName: BaiduMapStaticController
|
||||||
@ -24,8 +24,8 @@ public class BaiduMapStaticController {
|
|||||||
|
|
||||||
@GetMapping("{fileName}")
|
@GetMapping("{fileName}")
|
||||||
public void root(HttpServletResponse httpServletResponse, @PathVariable("fileName") String fileName) throws IOException {
|
public void root(HttpServletResponse httpServletResponse, @PathVariable("fileName") String fileName) throws IOException {
|
||||||
File file = ResourceUtil.getResourceFile("static/baidu-map/" + fileName);
|
InputStream inputStream = ResourceUtil.getJarResourceInputStream("static/baidu-map/" + fileName);
|
||||||
StaticResourceRequestUtil.download(httpServletResponse, file, fileName);
|
StaticResourceRequestUtil.download(httpServletResponse, inputStream, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user