Commit fff0095f authored by xiongjinke's avatar xiongjinke

修改

parent 591da3b3
......@@ -165,17 +165,28 @@ export default {
return this.$store.state.permission.routes
}
},
beforeRouteEnter(to, from, next) {
next(vm => {
if(from.name){
if (to.query.customerId){
let customerId = to.query.customerId
if(to.query.path){
vm.currentPath.pathName = to.query.path
watch: {
'$route'(to, from) {
// 检测查询参数的变化
if (to.query.customerId) {
if (this.companyId == 0) {
let customerId = to.query.customerId
this.association(customerId)
}
vm.association(customerId)
}
if (to.query.path) {
this.currentPath.pathName = to.query.path
}
}
},
beforeRouteLeave(to, from, next) {
next(vm => {
})
},
beforeRouteEnter(to, from, next){
next(vm => {
})
},
created() {
......@@ -237,10 +248,8 @@ export default {
this.$nextTick(() => {
this.customerInfo = res.data
this.customerId = res.data.customerId
this.isCustomer = true
this.isCompanyId = true
})
if(res.data.companyId == this.companyId && this.companyInfo){
if(res.data.companyId == this.companyId){
this.$nextTick(() => {
this.isCustomer = true
this.isCompany = true
......@@ -260,20 +269,23 @@ export default {
this.$nextTick(() => {
this.isCustomer = true
this.isCompany = true
this.currentPath.pathName = 'overview'
})
this.currentPath.pathName = 'overview'
}
}
}).catch(err => {
this.currentPath.pathName = 'overview'
this.$nextTick(() => {
this.currentPath.pathName = 'overview'
this.isCompany = true
})
})
}else{
this.isCompany = true
this.$nextTick(() => {
this.isCompany = true
this.currentPath.pathName = 'overview'
})
}
}
},
}
}
......
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