Commit 66367012 authored by zhengke's avatar zhengke

修改

parent 5bfdd63a
......@@ -19,6 +19,8 @@ Vue.prototype.domainManager = function () {
DomainUrl: domainUrl,
//常用提交数据URL
PostUrl: domainUrl + "/api/common/post",
javaUrl: 'http://efficient.oytour.com'
};
return obj;
}
......@@ -59,6 +61,56 @@ Vue.prototype.apipost = function (cmd, msg, successCall, faildCall) {
}, faildCall)
}
Vue.prototype.apiJavaPost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
var apiurl = this.domainManager().javaUrl + cmd;
var timestamp = (new Date()).valueOf();
this.apiurl = apiurl;
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(`msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
var postData = {
"msg": msg,
"timestamp": timestamp,
"token": token,
"sign": md5Str
}
if (localStorage.g && localStorage.g != 'undefined') {
var groupJson= JSON.parse(localStorage.g);
postData.groupId = groupJson.i;
}
this.$axios.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
})
} else if (res.data.resultCode == 10005) {
this.$router.go(-1)
} else {
if (res.data.award && res.data.award.mName !== null) {
this.MsgBus.$emit('openRaffleTickets', res.data.award)
}
successCall(res)
}
}, faildCall)
},
//获取缓存
Vue.prototype.getLocalStorage = function () {
try {
......
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