代码提交
parent
a71d6031d5
commit
2b4f7b7096
|
@ -1,3 +1,3 @@
|
|||
。idea/
|
||||
.idea/
|
||||
target/
|
||||
*.iml
|
8
pom.xml
8
pom.xml
|
@ -67,6 +67,7 @@
|
|||
<!--指定打包的配置文件,且用filtering设置开启过滤-->
|
||||
<include>application*.yml</include><!--这里使用占位符进行动态引用以确定具体的打包文件-->
|
||||
<include>application.yml</include><!--主配置文件必须打包-->
|
||||
<include>**/*.xml</include> <!-- 包含所有 XML -->
|
||||
</includes>
|
||||
<filtering>true</filtering><!--开启过滤,在打包时application.yml中配置的@env@将被确定到底是什么变量-->
|
||||
</resource>
|
||||
|
@ -166,13 +167,6 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.fastinfoset</groupId>
|
||||
<artifactId>FastInfoset</artifactId>
|
||||
<version>1.2.18</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
|
|
|
@ -92,9 +92,12 @@ public class FileService extends ServiceImpl<FileMapper, MyFile> {
|
|||
throw new ServiceException(constants.CODE_500,"文件不存在");
|
||||
}
|
||||
try {
|
||||
ServletOutputStream os = response.getOutputStream();
|
||||
response.reset();
|
||||
response.addHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode(fileName,"UTF-8"));
|
||||
response.setContentType("application/octet-stream");
|
||||
|
||||
ServletOutputStream os = response.getOutputStream();
|
||||
|
||||
os.write(FileUtil.readBytes(file));
|
||||
os.flush();
|
||||
os.close();
|
||||
|
|
|
@ -23,5 +23,5 @@ spring:
|
|||
connect-timeout: 30000ms
|
||||
|
||||
file:
|
||||
file: /home/fzhang5/file/file/
|
||||
avatar: /home/fzhang5/file/avatar/
|
||||
file: D:/devWorkSpace/file/
|
||||
avatar: D:/devWorkSpace/avatar/
|
||||
|
|
|
@ -7,4 +7,4 @@ mybatis:
|
|||
map-underscore-to-camel-case: true
|
||||
spring:
|
||||
profiles:
|
||||
active: @profile@
|
||||
active: test
|
||||
|
|
Loading…
Reference in New Issue