| | |
| | | var pageCurr; |
| | | var odtotr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin','upload'], function(){ |
| | |
| | | // 监听行工具事件 |
| | | table.on('tool(appVersion)', function(obj){ |
| | | var data = obj.data; |
| | | odtotr = data |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | |
| | | parent.location.reload() |
| | | }) |
| | | }else{ |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: 'APP下载', |
| | | content: $('#qrCode').html(), |
| | | success: function (layero, dIndex) { |
| | | var ipAddress = ''; |
| | | $.ajax({ |
| | | url: baseUrl+"/appVersion/downloadApp/getIp", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | cache: false, |
| | | processData: false, |
| | | contentType: false, |
| | | success: function (res) { |
| | | ipAddress = res.data |
| | | admin.open({ |
| | | type: 1, |
| | | area: '400px', |
| | | title: 'APP下载', |
| | | content: |
| | | `<div> |
| | | <img class="template-code" |
| | | src="${baseUrl}/mac/code/auth?type=2¶m=${ipAddress}/${baseUrl}/appVersion/downloadApp/${data.path}" |
| | | width="100%"> |
| | | </div> |
| | | <div style="height: 50px;display: flex;align-items: center;justify-content: center"> |
| | | <button class="layui-btn layui-btn-sm" lay-event="down" onclick="download()">下载到本地</button> |
| | | </div>`, |
| | | success: function (layero, dIndex) { |
| | | |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | // window.open(baseUrl + "/appVersion/downloadApp/" + data.path); |
| | | } |
| | | break; |
| | |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
| | | |
| | | function download() { |
| | | console.log(1) |
| | | layer.closeAll(); |
| | | window.open(baseUrl + "/appVersion/downloadApp/" + odtotr.path); |
| | | } |
| | | |