Commit b91549d3 authored by youjie's avatar youjie

no message

parent c88a8075
...@@ -14,7 +14,8 @@ export default { ...@@ -14,7 +14,8 @@ export default {
//CRM API //CRM API
let domainUrl = ""; let domainUrl = "";
// domainUrl = "http://192.168.10.46:8500"; // domainUrl = "http://192.168.10.46:8500";
domainUrl = "http://192.168.10.9:8098"; // domainUrl = "http://192.168.10.9:8098";
domainUrl = "http://192.168.10.266";
// domainUrl = "http://crm.oytour.com" // domainUrl = "http://crm.oytour.com"
//domainUrl = "http://localhost:5003"; //domainUrl = "http://localhost:5003";
let locationName = window.location.hostname; let locationName = window.location.hostname;
...@@ -41,6 +42,7 @@ export default { ...@@ -41,6 +42,7 @@ export default {
PostUrl: domainUrl, PostUrl: domainUrl,
//旅游ERPApi地址 //旅游ERPApi地址
ERPApiUrl: domainPostUrl + "/api/common/post", ERPApiUrl: domainPostUrl + "/api/common/post",
ERPApiUrlFile: domainPostUrl + "/api/file/GetFileFromWebApi",
javaUrl: locationName.indexOf('testb2b') == -1 ? "http://efficient.oytour.com" : locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://47.96.12.235:9001" : "http://192.168.10.215:9000", javaUrl: locationName.indexOf('testb2b') == -1 ? "http://efficient.oytour.com" : locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://47.96.12.235:9001" : "http://192.168.10.215:9000",
ViittoFileUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://staticfile.oytour.com" : 'http://192.168.10.214:8130', ViittoFileUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://staticfile.oytour.com" : 'http://192.168.10.214:8130',
UploadUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://uploadfile.oytour.com" : "http://192.168.10.214:8120", UploadUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://uploadfile.oytour.com" : "http://192.168.10.214:8120",
...@@ -351,5 +353,53 @@ export default { ...@@ -351,5 +353,53 @@ export default {
console.log("GetLocalFile", res); console.log("GetLocalFile", res);
}); });
} }
//erp下载文件
Vue.prototype.GetLocalFile2 = function(cmd, msg, fileName, callBack) {
if (msg == null || msg == "") {
msg = {}
}
var apiurl = this.domainManager().ERPApiUrlFile;
var timestamp = (new Date()).valueOf();
var token = "";
var key = "";
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().token;
key = this.getLocalStorage().SecretKey;
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
var postData = {
"cmd": cmd,
"msg": msg,
"timestamp": timestamp,
"token": token,
"sign": md5Str
}
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path,
},
responseType: 'blob'
}).then((res) => {
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel"
})
let url = URL.createObjectURL(blob);
let link = document.createElement('a');
link.href = url;
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
if (callBack) {
var result = {
Code: 1
};
callBack(result);
}
}).catch(function(res) {
console.log("GetLocalFile", res);
});
}
} }
} }
\ No newline at end of file
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