重构
This commit is contained in:
@ -101,13 +101,16 @@ export default {
|
||||
if (!id) {
|
||||
return
|
||||
}
|
||||
const currentSite = (this.$store.getters.zdList || []).find(item => item.siteId === id)
|
||||
const siteName = currentSite && currentSite.siteName ? currentSite.siteName : ''
|
||||
localStorage.setItem('global_site_id', id)
|
||||
if (id !== this.$route.query.siteId) {
|
||||
if (id !== this.$route.query.siteId || siteName !== (this.$route.query.siteName || '')) {
|
||||
this.$router.push({
|
||||
path: this.$route.path,
|
||||
query: {
|
||||
...this.$route.query,
|
||||
siteId: id
|
||||
siteId: id,
|
||||
siteName
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user