自动化立体仓库 - WMS系统
whycq
2024-03-25 3c9c1411a8f590aa057dcde7042fe283013bcad0
# app version
3个文件已修改
47 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/AppVersionController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/appVersion/appVersion.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/appVersion/appVersion.html 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/AppVersionController.java
@@ -218,4 +218,31 @@
            response.setStatus(404);
        }
    }
    @RequestMapping("/appVersion/downloadApp/{filename}/qrDownload")
    public void qrDownload(@PathVariable String filename, HttpServletResponse response) {
        try {
            ClassPathResource pathResource = new ClassPathResource("appVersion/" + filename);
            File file = pathResource.getFile();
            InputStream inputStream = pathResource.getInputStream();
            //输出文件
            InputStream fis = new BufferedInputStream(inputStream);
            byte[] buffer = new byte[fis.available()];
            fis.read(buffer);
            fis.close();
            response.reset();
            //获取文件的名字再浏览器下载页面
            String name = file.getName();
            response.addHeader("Content-Disposition", "attachment;filename=" + new String(name.getBytes(), "iso-8859-1"));
            response.addHeader("Content-Length", "" + file.length());
            OutputStream out = new BufferedOutputStream(response.getOutputStream());
            response.setContentType("application/octet-stream");
            out.write(buffer);
            out.flush();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            response.setStatus(404);
        }
    }
}
src/main/webapp/static/js/appVersion/appVersion.js
@@ -177,7 +177,16 @@
                        parent.location.reload()
                    })
                }else{
                    window.open(baseUrl + "/appVersion/downloadApp/" + data.path);
                    admin.open({
                        type: 1,
                        area: '600px',
                        title: 'APP下载',
                        content: $('#qrCode').html(),
                        success: function (layero, dIndex) {
                        }
                    })
                    // window.open(baseUrl + "/appVersion/downloadApp/" + data.path);
                }
                break;
        }
src/main/webapp/views/appVersion/appVersion.html
@@ -67,6 +67,7 @@
<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/appVersion/appVersion.js" charset="utf-8"></script>
</body>
<!-- 表单弹窗 -->
<script type="text/html" id="editDialog">
    <form id="detail" lay-filter="detail" class="layui-form admin-form model-form" >
@@ -109,5 +110,13 @@
        </div>
    </form>
</script>
<!-- 二维码下载弹窗 -->
<script type="text/html" id="qrCode">
    <div>123</div>
    {{#each data}}
    <img class="template-code template-qrcode" src="{{this.barcodeUrl}}" width="80%">
    {{/each}}
</script>
</html>