Commit e8931e0d authored by zhengke's avatar zhengke

修改

parent ba7814f9
import md5 from 'js-md5'
export default{
data:{
loginUser: {},
......@@ -5,6 +7,7 @@ export default{
},
install(Vue, options){
//ERP本地缓存
Vue.prototype.md5 = md5;
Vue.prototype.getLocalStorage = function () {
console.log('进入~~~~~~')
var localStorageData = window.localStorage["userInfo"];
......@@ -14,73 +17,75 @@ export default{
return null;
}
},
//HTTP提交数据
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall, isOnline) {
if (this.$route.name.indexOf('login') === -1 && this.$route.name.indexOf('clientConfirm') === -1 &&
this.$route.name.indexOf('confirmationOrderDownLoad') === -1 && this.$route.name.indexOf('PrintPage') === -1 &&
this.$route.name.indexOf('TravelContractConfirm') === -1 && this.$route.name.indexOf('ViittoContractConfirm') === -1 &&
this.$route.name.indexOf('OrderProfitLossList') === -1
) {
//域名管理对象
Vue.prototype.domainManager = function () {
let domainUrl = '';
let mallUrl = ""; //商城API
let locationName = window.location.hostname;
// domainUrl = "http://127.0.0.1";
domainUrl = "http://192.168.1.13:8083";
//domainUrl = "http://192.168.1.21:8069";
let previousPathInfo = {
path: this.$route.name,
query: this.$route.query
}
localStorage.previousPathInfo = JSON.stringify(previousPathInfo);
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://192.168.2.215:9000";
//商城API
mallUrl = "http://192.168.1.21:8014";
if (locationName.indexOf('testerp.oytour') !== -1) {
domainUrl = "http://testapi.oytour.com";
mallUrl = "https://mallapi.oytour.com";
} else if (locationName.indexOf('oytour') !== -1) {
domainUrl = "http://reborn.oytour.com";
mallUrl = "https://mallapi.oytour.com";
}
var obj = {
//主地址
DomainUrl: domainUrl,
//常用提交数据URL
PostUrl: domainUrl + "/api/common/post",
//上传文件URL
UploadFileUrl: domainUrl + '/api/File/post',
//本站模板文件下载地址
LocalTemplateFileDownLoadUrl: domainUrl,
//酒店接口
HotelApi: "http://reborn.oytour.com/api/common/post",
//阿里服务器地址
AliUrl: "https://reborndev.oss-cn-hangzhou.aliyuncs.com",
//本站文件流下载地址
LocalFileStreamDownLoadUrl: domainUrl + "/api/file/GetFileFromWebApi",
//PDF文件预览地址
PDFViewUrl: domainUrl + "/plug/pdf/web/viewer.html?file=",
//SocketUrl
WebSocketUrl: "ws://192.168.1.110:8080?account=",
//google地图图片地址
GoogleMapImageUrl: "http://imgfile.oytour.com",
//上传站点
UploadUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://upload.oytour.com" : "http://192.168.1.214:8120",
//文件站点
ViittoFileUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://imgfile.oytour.com" : 'http://192.168.1.214:8130',
javaUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? (locationName.indexOf('oytour') !== -1 ? "http://efficient.oytour.com" : "http://47.96.12.235:9001") : "http://192.168.2.17:8087",
javaUrlNew: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? (locationName.indexOf('oytour') !== -1 ? "http://property.oytour.com" : "http://47.96.12.235:9001") : "http://192.168.2.17:8087",
//Java接口本站文件流下载地址
JavaLocalFileStreamDownLoadUrl: javaUrldo,
mallUrl: mallUrl,
};
return obj;
},
//HTTP提交数据
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall, isOnline) {
if (msg == null || msg == "") {
msg = {}
}
var apiurl = this.domainManager().PostUrl;
//酒店接口
if (isOnline) {
apiurl = this.domainManager().HotelApi;
}
var timestamp = (new Date()).valueOf();
this.apiurl = apiurl;
if (this.$route.path.toLowerCase() == "/signature") {
this.$router.push({
path: '/signature'
})
} else if (this.$route.path == "/clientConfirm") {
let TCID = this.$route.query.TCID;
let orderID = this.$route.query.orderID;
this.$router.push({
name: "clientConfirm",
query: {
TCID: TCID,
orderID: orderID
}
})
} else if (this.$route.path == "/TravelContractConfirm") {
let ContractId = this.$route.query.ContractId;
this.$router.push({
name: "TravelContractConfirm",
query: {
ContractId: ContractId
}
})
} else if (this.$route.path == "/ViittoContractConfirm") {
let Id = this.$route.query.Id;
this.$router.push({
name: "ViittoContractConfirm",
query: {
Id: Id
}
})
} else {
if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") {
this.$router.push({
path: '/login'
})
}
}
var token = "";
var key = "";
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().token;
key = this.getLocalStorage().SecretKey;
}
var timestamp = (new Date()).valueOf();
var apiurl = this.domainManager().PostUrl;
this.apiurl = apiurl;
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage = 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