fix: 修复由数据修改导致的重复请求问题

This commit is contained in:
@changcode
2022-02-08 10:48:36 +08:00
parent 5bde84757d
commit f0e113a1d1
2 changed files with 50 additions and 2 deletions

View File

@@ -48,8 +48,32 @@ router.beforeEach((to, from, next) => {
store.commit('setButtonList', arr)
store.commit('setRoleList', res.data.roles)
bus.$emit('login')
const path = []
if (menuList) {
menuList.forEach(e => {
if (e.route) {
path.push(e.route)
} else {
if (e.children) {
e.children.forEach(e => {
if (e.route) {
path.push(e.route)
} else {
if (e.children) {
e.children.forEach(e => {
if (e.route) {
path.push(e.route)
}
})
}
}
})
}
}
})
}
router.push({
path: menuList[0].children[0].route,
path: path[0],
query: {
t: +new Date()
}

View File

@@ -86,8 +86,32 @@ const user = {
store.commit('setButtonList', arr)
store.commit('setRoleList', res.data.roles)
bus.$emit('login')
const path = []
if (menuList) {
menuList.forEach(e => {
if (e.route) {
path.push(e.route)
} else {
if (e.children) {
e.children.forEach(e => {
if (e.route) {
path.push(e.route)
} else {
if (e.children) {
e.children.forEach(e => {
if (e.route) {
path.push(e.route)
}
})
}
}
})
}
}
})
}
router.push({
path: menuList[0].children[0].route,
path: path[0],
query: {
t: +new Date()
}