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

页面修改

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