mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 01:23:55 +08:00
解决提示框遮挡问题,优化UserManagement和HeaderBar布局,导航栏重复点击警告,退出跳转页面的优化
This commit is contained in:
@@ -76,6 +76,20 @@ const router = new VueRouter({
|
||||
routes
|
||||
})
|
||||
|
||||
// 全局处理重复导航,改为刷新页面
|
||||
const originalPush = VueRouter.prototype.push
|
||||
VueRouter.prototype.push = function push(location) {
|
||||
return originalPush.call(this, location).catch(err => {
|
||||
if (err.name === 'NavigationDuplicated') {
|
||||
// 如果是重复导航,刷新页面
|
||||
window.location.reload()
|
||||
} else {
|
||||
// 其他错误正常抛出
|
||||
throw err
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 需要登录才能访问的路由
|
||||
const protectedRoutes = ['home', 'RoleConfig', 'DeviceManagement', 'UserManagement', 'ModelConfig']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user