Commit 1da1b894 authored by 黄奎's avatar 黄奎

页面修改

parent aee08197
......@@ -87,7 +87,6 @@
},
created() {
this.userInfo = this.getLocalStorageSupplier();
console.log("this.userinfo", this.userInfo);
let language = localStorage.language;
if (!language) {
this.language = 'zh-CN';
......@@ -104,9 +103,6 @@
methods: {
goUrl(url, id, index) {
console.log("url", url);
console.log("id", id);
console.log("index", index);
this.chosenIndex = id;
if (localStorage.openMode && localStorage.openMode == 1)
this.$router.push({
......@@ -128,7 +124,7 @@
this.$store.dispatch("logout")
localStorage.removeItem("userInfo");
localStorage.removeItem("previousPathInfo");
location.href = '/SupplierLogin';
this.$router.push({ path: "/SupplierLogin" });
},
settingSys: function () {
this.MsgBus.$emit('settingOpen')
......
......@@ -293,7 +293,7 @@
//登录成功
var userData = jsonData.data;
var userJson = JSON.stringify(userData);
localStorage.SupplierInfo = userJson;
localStorage.userInfo = userJson;
this.$router.push({
path: "/SupplierIndex"
});
......
......@@ -118,11 +118,7 @@ export default {
Vue.prototype.domainManager = function () {
let domainUrl = '';
let locationName = window.location.hostname;
domainUrl = "http://192.168.2.214:8082"; //214主域名
domainUrl = "http://192.168.2.65:8025"; //214主域名
// domainUrl = "http://192.168.0.119:8082";
domainUrl = "http://192.168.2.16:8083";
// domainUrl = "http://reborn.oytour.com"
domainUrl = "http://192.168.2.214:8082";
if (locationName.indexOf('oytour') !== -1) {
domainUrl = "http://reborn.oytour.com";
} else if (locationName.indexOf('viitto') !== -1) {
......@@ -312,25 +308,23 @@ export default {
if (msg == null || msg == "") {
msg = {}
}
var apiNewurl = this.domainManager().DomainUrl;
var apiNewurl = this.domainManager().PostUrl;
var timestamp = (new Date()).valueOf();
apiNewurl = apiNewurl + "/Api/Trip/" + cmd;
if (this.$route.path.toLowerCase() == "/signature") {
this.$router.push({
path: '/signature'
})
} else {
if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") {
if (!this.getLocalStorageSupplier().userInfo && this.getLocalStorageSupplier().userInfo != "" && this.$route.path.toLowerCase() != "/supplierlogin") {
}
else
{
this.$router.push({
path: '/login'
path: '/SupplierLogin'
})
}
}
var token = "";
var key = "";
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().token;
key = this.getLocalStorage().SecretKey;
if (this.getLocalStorageSupplier() != null) {
token = this.getLocalStorageSupplier().Token;
key = this.getLocalStorageSupplier().SecretKey;
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
......@@ -340,7 +334,7 @@ export default {
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"uid": this.getLocalStorage().EmployeeId
"uid": this.getLocalStorageSupplier().SupplierAccountId
}
this.$http.post(apiNewurl, postData, {
......@@ -352,10 +346,8 @@ export default {
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
path: '/SupplierLogin'
});
} else if (res.resultCode == 10005) {
this.$router.go(-1);
} else {
successCall(res);
}
......@@ -465,6 +457,14 @@ export default {
}
},
Vue.prototype.getLocalStorageSupplier = function () {
var localStorageData = window.localStorage["SupplierInfo"];
if (localStorageData !== undefined && localStorageData != 'SupplierInfo') {
return JSON.parse(localStorageData);
} else {
return null;
}
},
//PDF预览
Vue.prototype.previewPDF = function (url) {
......
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