title跳转登录页面显示问题

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

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

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

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

Loading…
Cancel
Save