Commit 8ca738ae authored by 黄奎's avatar 黄奎

域名调整

parent 0f36fc1b
......@@ -312,12 +312,8 @@
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
this.dataList.forEach(x => {
let Url = "http://admin.oytour.com";
if (this.isOnline()) {
Url = Url + '/#/TravelContractConfirm?ContractId=' + x.ID;
} else {
Url = Url + ":8081/" + '#/TravelContractConfirm?ContractId=' + x.ID;
}
let Url = this.domainManager().erpRoutingUrl;
Url = Url + '/#/TravelContractConfirm?ContractId=' + x.ID;
x.Url = Url;
})
this.tableData = this.dataList
......
const isOnline = function() {
const isOnline = function () {
return process.env.NODE_ENV !== 'development';
}
export default function() {
export default function () {
//CRM API
let domainUrl = "";
// domainUrl = "http://192.168.10.46:8500";
// domainUrl = "http://192.168.10.128:5003";
domainUrl = "http://192.168.10.9:8098";
// domainUrl = "http://crm.oytour.com"
//domainUrl = "http://localhost:5003";
domainUrl = "http://192.168.5.46:5003";
let locationName = window.location.hostname;
//旅游ERPApi
let domainPostUrl = ""
domainPostUrl = "http://192.168.10.9:8083";
//domainPostUrl = "http://192.168.10.46";
domainPostUrl = "http://192.168.5.46";
if (isOnline()) {
if (window.location.host.indexOf('fcrmyx.oytour.com') != -1) {
domainUrl = "http://crm.oytour.com"
......@@ -23,6 +18,20 @@ export default function() {
domainPostUrl = "http://testapi.oytour.com"
}
}
let erpRoutingUrl = "";
var storageUser = this.getLocalStorage();
if (locationName.indexOf('oytour') !== -1 || locationName.indexOf('testb2b.oytour.com') !== -1) {
erpRoutingUrl = "http://admin.oytour.com/#/";
if (storageUser && storageUser.ERPUrl) {
erpRoutingUrl = storageUser.ERPUrl + "/#/";
}
} else {
erpRoutingUrl = "http://localhost:8080/#/";
if (storageUser && storageUser.ERPUrl) {
erpRoutingUrl = storageUser.ERPUrl + "/#/";
}
}
var obj = {
//主地址
DomainUrl: domainUrl,
......@@ -37,7 +46,7 @@ export default function() {
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',
UploadUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://uploadfile.oytour.com" : "http://192.168.10.214:8120",
erpRoutingUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://admin.oytour.com/#/" : "http://localhost:8081/#/"// "http://www.test.com:8081/#/",
erpRoutingUrl: erpRoutingUrl
};
return obj;
}
\ No newline at end of file
......@@ -7,14 +7,14 @@ export default {
},
domainManager,
install(Vue, options) {
Vue.prototype.isOnline = function() {
Vue.prototype.isOnline = function () {
return process.env.NODE_ENV !== 'development';
},
//域名管理对象
Vue.prototype.domainManager = domainManager,
//消息成功提示
Vue.prototype.Success = function(msg) {
Vue.prototype.Success = function (msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -22,7 +22,7 @@ export default {
});
},
//错误提示
Vue.prototype.Error = function(msg) {
Vue.prototype.Error = function (msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -31,7 +31,7 @@ export default {
},
//一般提示
Vue.prototype.Info = function(msg) {
Vue.prototype.Info = function (msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -39,7 +39,7 @@ export default {
});
},
//警告提示
Vue.prototype.Warning = function(msg) {
Vue.prototype.Warning = function (msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -47,7 +47,7 @@ export default {
});
},
//Confirm
Vue.prototype.Confirm = function(msg, callback) {
Vue.prototype.Confirm = function (msg, callback) {
this.$confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
......@@ -67,7 +67,7 @@ export default {
//type : m_filt 填充 m_w 宽度固定 高度不固定 m_h 高度固定 宽度不固定
// w : 宽
// h : 高
Vue.prototype.compressImg = function(path, type, w, h) {
Vue.prototype.compressImg = function (path, type, w, h) {
let url = this.domainManager().UploadUrl;
let poise = 'width=';
w = w ? w : ''
......@@ -82,7 +82,7 @@ export default {
//旅游ERP接口
Vue.prototype.apipost2 = function(cmd, msg, successCall, faildCall, isOnline) {
Vue.prototype.apipost2 = function (cmd, msg, successCall, faildCall, isOnline) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -131,7 +131,7 @@ export default {
}
//CRM接口
Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) {
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -174,7 +174,7 @@ export default {
},
// 自动登录HTTP提交数据
Vue.prototype.apipostLogin = function(cmd, msg, successCall, faildCall) {
Vue.prototype.apipostLogin = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -217,7 +217,7 @@ export default {
},
//Java接口
Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
Vue.prototype.apiJavaPost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -269,7 +269,7 @@ export default {
},
//下载文件
Vue.prototype.GetLocalFile = function(cmd, msg, fileName, callBack) {
Vue.prototype.GetLocalFile = function (cmd, msg, fileName, callBack) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -311,57 +311,57 @@ export default {
};
callBack(result);
}
}).catch(function(res) {
}).catch(function (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);
});
//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