title跳转登录页面显示问题

cyl/dev
wangxia 2 years ago
parent 097240143f
commit 9367ff2fed

@ -6,6 +6,7 @@ Vue.use(Vuex);
export default new Vuex.Store({
state: {
joblist: {},
isLogin: false
},
mutations: {},
actions: {},

@ -53,6 +53,7 @@ service.interceptors.response.use(
(response) => {
// console.log(response);
let { msg, status } = response.data;
// status = 9999
// return response;
// console.log(status);
if (status == 9999) {

@ -103,7 +103,6 @@
</router-link>
<router-link to="/merchantBack" v-if="loginValue.agencyName == '郑州一才工作' && (loginValue.agencyRole == 2 || loginValue.agencyRole == 1 )">
<div>
<span>
<i class="iconfont icon-shangjiahoutai"></i>商家后台and1.0
</span>
@ -111,9 +110,7 @@
</div>
</router-link>
<router-link to="###" v-if="loginValue.agencyName == '郑州一才工作' && (loginValue.agencyRole == 2 || loginValue.agencyRole == 1 )">
<div
@click="goAdmin"
>
<div @click="goAdmin">
<span>
<i class="iconfont icon-shangjiahoutai"></i>商家后台and4.0
</span>
@ -339,33 +336,34 @@ export default {
},
userbaseInfo: JSON.parse(localStorage.getItem('LOGIN_DATA')),
loginPage: false,
routertitleindex: 0,
}
},
//
computed: {
routertitleindex: {
set() {},
get() {
const path = this.$route.fullPath
if (path.indexOf('serviceoutlets') > -1) {
return 2
} else if (path.indexOf('list') > -1 || path.indexOf('detail') > -1) {
return 1
} else if (path.indexOf('aboutus') > -1) {
return 3
} else if (path.indexOf('main') > -1) {
return 0
} else if (path.indexOf('mytownsman') > -1) {
return 4
} else if (path.indexOf('mybill') > -1) {
return 5
} else if (path.indexOf('dataStatistics') > -1) {
return 6
} else {
return 7
}
},
},
// routertitleindex: {
// set() {},
// get() {
// const path = this.$route.fullPath
// if (path.indexOf('serviceoutlets') > -1) {
// return 2
// } else if (path.indexOf('list') > -1 || path.indexOf('detail') > -1) {
// return 1
// } else if (path.indexOf('aboutus') > -1) {
// return 3
// } else if (path.indexOf('main') > -1) {
// return 0
// } else if (path.indexOf('mytownsman') > -1) {
// return 4
// } else if (path.indexOf('mybill') > -1) {
// return 5
// } else if (path.indexOf('dataStatistics') > -1) {
// return 6
// } else {
// return 7
// }
// },
// },
// isLogin() {
// return localStorage.getItem("LOGIN_DATA") !== null ? true : false;
// },
@ -379,16 +377,16 @@ export default {
//
watch: {
routertitleindex() {
const path = this.$route.fullPath
if (path.indexOf('serviceoutlets') > -1) {
this.laoxiangshow = true
} else if (path.indexOf('list') > -1 || path.indexOf('detail') > -1) {
this.laoxiangshow = true
} else if (path.indexOf('aboutus') > -1) {
this.laoxiangshow = false
} else {
this.laoxiangshow = true
}
// const path = this.$route.fullPath
// if (path.indexOf('serviceoutlets') > -1) {
// this.laoxiangshow = true
// } else if (path.indexOf('list') > -1 || path.indexOf('detail') > -1) {
// this.laoxiangshow = true
// } else if (path.indexOf('aboutus') > -1) {
// this.laoxiangshow = false
// } else {
// this.laoxiangshow = true
// }
this.showfooter()
},
$route: {
@ -400,8 +398,26 @@ export default {
// console.dir(this.navigationBarLocation);
window.addEventListener('scroll', this.navigationBarLocation)
window.addEventListener('scroll', this.windowScroll) //
if (to.fullPath.indexOf('serviceoutlets') > -1) {
this.routertitleindex = 2
} else if (to.fullPath.indexOf('list') > -1 || to.fullPath.indexOf('detail') > -1) {
this.routertitleindex = 1
} else if (to.fullPath.indexOf('aboutus') > -1) {
this.routertitleindex = 3
} else if (to.fullPath.indexOf('main') > -1) {
this.routertitleindex = 0
} else if (to.fullPath.indexOf('mytownsman') > -1) {
this.routertitleindex = 4
} else if (to.fullPath.indexOf('mybill') > -1) {
this.routertitleindex = 5
} else if (to.fullPath.indexOf('dataStatistics') > -1) {
this.routertitleindex = 6
} else {
this.routertitleindex = 7
}
if (to.fullPath == '/login') {
this.loginPage = true
this.isLogin = false
} else {
this.loginPage = false
}
@ -648,20 +664,20 @@ export default {
this.reload()
},
goAdmin(){
let obj = JSON.parse(localStorage.getItem("LOGIN_DATA"));
if(window.location.hostname == 'localhost'){
goAdmin() {
let obj = JSON.parse(localStorage.getItem('LOGIN_DATA'))
if (window.location.hostname == 'localhost') {
// URLtoken
window.location.href = 'http://localhost:3000/merchantManagement/homePage?token=' + obj.token + '&username=' + obj.user.userName + '&avatar=' + obj.imgSrc
}else{
} else {
//
localStorage.setItem('daotian_to_admin_token',obj.token)
localStorage.setItem('daotian_to_admin_avatar',obj.imgSrc)
localStorage.setItem('daotian_to_admin_username',obj.user.userName)
window.location.href = 'http://idaotian.com/dist2.0.0/#/merchantManagement/homePage';
}
localStorage.setItem('daotian_to_admin_token', obj.token)
localStorage.setItem('daotian_to_admin_avatar', obj.imgSrc)
localStorage.setItem('daotian_to_admin_username', obj.user.userName)
window.location.href = 'http://idaotian.com/dist2.0.0/#/merchantManagement/homePage'
}
},
},
}
</script>

Loading…
Cancel
Save