Commit 42000259 authored by 黄奎's avatar 黄奎

新增上传文件方法

parent 222a1019
......@@ -119,21 +119,16 @@ export default {
let lxymallUrl = ''; //国内游api
let crmUrl = ""; //crm API
let locationName = window.location.hostname;
// domainUrl = "http://192.168.10.128";
// domainUrl = "http://192.168.10.9:8083" // 刘东电脑
domainUrl = "http://192.168.10.226:8015";
// domainUrl = "http://reborn.oytour.com";
domainUrl = "http://192.168.10.9:8083"; // 刘东电脑
let crmLocalFileStreamDownLoadUrl = "";
crmLocalFileStreamDownLoadUrl = locationName.indexOf('oytour') !== -1 ? "http://crm.oytour.com" : "http://testcrm.oytour.com";
let javaUrldo = "";
javaUrldo = locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? (locationName.indexOf('oytour') !== -1 ? "http://efficient.oytour.com" : "http://47.96.12.235:9001") : "http://127.0.0.1:9000";
//商城API
// mallUrl = "http://192.168.1.48:8019";
mallUrl = "http://192.168.20.13:8088";
lxymallUrl = "http://192.168.20.13:8088";
// crmUrl = "http://192.168.10.36:8098"
// crmUrl = "http://192.168.10.9:8098"
crmUrl = "http://crm.oytour.com"
crmUrl = "http://192.168.10.36:8098"
if (locationName.indexOf('testerp.oytour') !== -1) {
domainUrl = "http://testapi.oytour.com";
mallUrl = "https://mallapi.oytour.com";
......@@ -150,7 +145,6 @@ export default {
DomainUrl: domainUrl,
//常用提交数据URL
PostUrl: domainUrl + "/api/common/post",
//上传文件URL
UploadFileUrl: domainUrl + '/api/File/post',
//本站模板文件下载地址
......@@ -358,9 +352,7 @@ export default {
f: c
});
});
return Promise.resolve(config)
}, error => {
return Promise.reject(error)
})
......@@ -382,9 +374,6 @@ export default {
successCall(res);
}
}, faildCall)
},
// CRM接口
Vue.prototype.crmapipost = function (cmd, msg, successCall, faildCall, isOnline) {
......@@ -440,9 +429,7 @@ export default {
}
var timestamp = (new Date()).valueOf();
this.apiurl = apiurl;
var data = JSON.parse(localStorage.crmuserInfo)
if (this.$route.path.toLowerCase() == "/signature") {
this.$router.push({
path: '/signature'
......@@ -1028,6 +1015,21 @@ export default {
})
},
//证件识别
Vue.prototype.UploadCard = function (type, base64Str, successCall, faildCall) {
var apiurl = this.domainManager().UploadUrl + '/Upload/UploadBlobHuZhao?Type=' + type;
var formData = new FormData();
formData.append("myfile", base64Str);
this.$http.post(apiurl, formData, {
headers: {
"Content-Type": "application/x-www-form-urlencoded;"
},
}).then(function (res) {
if (successCall) {
successCall(res)
}
})
},
//Blob文件上传
Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
let that = this;
......@@ -1677,7 +1679,7 @@ export default {
} else {
return false
}
}else if (type == 3) {
} else if (type == 3) {
if (img.indexOf('.png') != -1 || img.indexOf('.PNG') != -1 ||
img.indexOf('.GIF') != -1 || img.indexOf('.gif') != -1 ||
img.indexOf('.JPEG') != -1 || img.indexOf('.jpeg') != -1 ||
......@@ -1687,7 +1689,7 @@ export default {
} else {
return false
}
}else{
} else {
if (img.indexOf('.DOCX') != -1 || img.indexOf('.docx') != -1 ||
img.indexOf('.DOC') != -1 || img.indexOf('.doc') != -1 ||
img.indexOf('.XLSX') != -1 || img.indexOf('.xlsx') != -1 ||
......@@ -1696,13 +1698,13 @@ export default {
img.indexOf('.PPTX') != -1 || img.indexOf('.pptx') != -1 ||
img.indexOf('.PDF') != -1 || img.indexOf('.pdf') != -1) {
return 1
}else if(img.indexOf('.png') != -1 || img.indexOf('.PNG') != -1 ||
} else if (img.indexOf('.png') != -1 || img.indexOf('.PNG') != -1 ||
img.indexOf('.GIF') != -1 || img.indexOf('.gif') != -1 ||
img.indexOf('.JPEG') != -1 || img.indexOf('.jpeg') != -1 ||
img.indexOf('.JPG') != -1 || img.indexOf('.jpg') != -1 ||
img.indexOf('.BMP') != -1 || img.indexOf('.bmp') != -1) {
return 3
}else{
} else {
return 0
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment