项目pom文件添加二维码操作,和文件打包的maven支持:
<!--二维码相关 start-->
<dependency>
<groupId>net.glxn.qrgen</groupId>
<artifactId>javase</artifactId>
<version>2.0</version>
</dependency>
<!--二维码相关 end-->
<!--文件打包相关 start-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.12</version>
</dependency>
<!--文件打包相关 end-->
前台代码:
<button type="button" onclick="downloadzip()">下载</button>
js(我用了thymeleaf模板)代码: