Răsfoiți Sursa

修复人才认定申请中,附件模板文件下载出错

sugangqiang 2 ani în urmă
părinte
comite
c053f3cfcd

+ 5 - 0
app/common/controller/Api.php

@@ -475,6 +475,11 @@ class Api extends BaseController {
                 $filename = $fileinfo["orignName"];
                 $url = $fileinfo["url"];
                 break;
+            case 5:
+                $fileinfo = Db::table("new_common_filetype")->where($where)->findOrEmpty();
+                $filename = $fileinfo["templateUrl"];
+                $url = $fileinfo["templateUrl"];
+                break;
         }
         $filepath = "storage/" . $url;     // 下载文件名
         if (!file_exists($filepath)) {

+ 3 - 3
public/static/modular/gate/talentInfo/new_talentInfo_info.js

@@ -248,7 +248,7 @@ TalentInfoInfoDlg.initFileTypeColumn = function () {
                 if (value == null || value == '' || value == 'null') {
                     return '无';
                 }
-                return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
+                return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',5)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
                         "<i class=\"fa fa-download\"></i>下载" +
                         "</button>";
             }
@@ -540,7 +540,7 @@ TalentInfoInfoDlg.ajaxGetConditionFile = function (source) {
                     name = '<i class="fa fa-paste"></i>' + filetype.name;
                 }
                 var uploadbtn = TalentInfoInfoDlg.validUploadButton(1, filetype.id, '', tableIndex, key);
-                var templateUrl = '<button type="button" onclick="TalentInfoInfoDlg.downloadFile("' + filetype.id + '",3)" style="margin-right: 10px" class="btn btn-xs btn-primary">\n\
+                var templateUrl = '<button type="button" onclick="TalentInfoInfoDlg.downloadFile("' + filetype.id + '",5)" style="margin-right: 10px" class="btn btn-xs btn-primary">\n\
 <i class=\"fa fa-download\"></i>下载""</button>"';
                 html += '<tr data-index="' + key + '">\n\
                                 <td class="uitd_showTip" style="text-align: center; vertical-align: middle; width: 30%; ">' + name + '</td> \n\
@@ -1083,7 +1083,7 @@ TalentInfoInfoDlg.callBack = function (data) {
     }
 }
 TalentInfoInfoDlg.downloadFile = function (id, type) {
-    window.location.href = Feng.ctxPath + "/api/common/downloadFile?id=" + id + "&type=" + type;
+    window.location.href = Feng.ctxPath + "/common/api/downloadFile?id=" + id + "&type=" + type;
 }
 
 //设置不可修改的字段

+ 2 - 2
public/static/modular/gate/talentInfo/talentInfo_ic_info.js

@@ -525,7 +525,7 @@ TalentInfoInfoDlg.initFileTypeColumn = function () {
                 if (value == null || value == '' || value == 'null') {
                     return '无';
                 }
-                return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
+                return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',5)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
                         "<i class=\"fa fa-download\"></i>下载" +
                         "</button>";
             }
@@ -558,7 +558,7 @@ TalentInfoInfoDlg.callBack = function (data) {
     }
 }
 TalentInfoInfoDlg.downloadFile = function (id, type) {
-    window.location.href = Feng.ctxPath + "/api/common/downloadFile?id=" + id + "&type=" + type;
+    window.location.href = Feng.ctxPath + "/common/api/downloadFile?id=" + id + "&type=" + type;
 }
 //设置不可修改的字段
 TalentInfoInfoDlg.setNoChangeField = function () {

+ 2 - 2
public/static/modular/gate/talentInfo/talentInfo_ic_select.js

@@ -175,7 +175,7 @@ TalentInfoInfoDlg.initFileTypeColumn = function () {
                 if(value==null||value==''||value=='null'){
                     return '无';
                 }
-                return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('"+row.id+"',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
+                return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('"+row.id+"',5)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
                     "<i class=\"fa fa-download\"></i>下载" +
                     "</button>";
             }
@@ -185,7 +185,7 @@ TalentInfoInfoDlg.initFileTypeColumn = function () {
 };
 
 TalentInfoInfoDlg.downloadFile = function (id,type){
-    window.location.href = Feng.ctxPath + "/api/common/downloadFile?id=" + id + "&type="+type;
+    window.location.href = Feng.ctxPath + "/common/api/downloadFile?id=" + id + "&type="+type;
 }
 
 $(function() {

+ 2 - 2
public/static/modular/gate/talentInfo/talentInfo_select.js

@@ -26,7 +26,7 @@ TalentInfoInfoDlg.initFileTypeColumn = function () {
                 if (value == null || value == '' || value == 'null') {
                     return '无';
                 }
-                return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
+                return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',5)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
                         "<i class=\"fa fa-download\"></i>下载" +
                         "</button>";
             }
@@ -167,7 +167,7 @@ TalentInfoInfoDlg.initFileTable = function () {
 }
 
 TalentInfoInfoDlg.downloadFile = function (id, type) {
-    window.location.href = Feng.ctxPath + "/api/common/downloadFile?id=" + id + "&type=" + type;
+    window.location.href = Feng.ctxPath + "/common/api/downloadFile?id=" + id + "&type=" + type;
 }
 
 

+ 1 - 1
public/static/modular/talentIdentify/talentInfo/talentInfo_common_check.js

@@ -31,7 +31,7 @@ TalentInfoInfoDlg.initFileTypeColumn = function () {
                 if (value == null || value == '' || value == 'null') {
                     return '';
                 }
-                return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
+                return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',5)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
                         "<i class=\"fa fa-download\"></i>下载" +
                         "</button>";
             }