remove useless code

This commit is contained in:
hal-wang 2021-01-25 20:14:44 +08:00
parent 57628713ee
commit ad1b1ef223
3 changed files with 17 additions and 33 deletions

View File

@ -1,21 +1,5 @@
import AdminLayout from '@/components/AdminLayout'
const routes = [
{
path: '/frpc/config',
component: AdminLayout,
meta: {
icon: 'config'
},
children: [
{
path: '',
component: () => import('@/views/frpc/Configure'),
meta: {
title: 'Configure'
}
}
]
},
{
path: '/frpc',
component: AdminLayout,
@ -31,6 +15,22 @@ const routes = [
}
}
]
},
{
path: '/frpc/config',
component: AdminLayout,
meta: {
icon: 'config'
},
children: [
{
path: '',
component: () => import('@/views/frpc/Configure'),
meta: {
title: 'Configure'
}
}
]
}
]

View File

@ -4,7 +4,7 @@ import AdminLayout from '@/components/AdminLayout'
Vue.use(Router)
const allRoutes = [
export const routes = [
{
path: '/',
component: AdminLayout,
@ -34,20 +34,6 @@ const allRoutes = [
}
]
// filter routes recursively
const filterRoutes = function(routes) {
const newRoutes = routes.filter(route => !!route)
for (const route in newRoutes) {
if (route.children) {
route.children = filterRoutes(route.children)
}
}
return newRoutes
}
export const routes = filterRoutes(allRoutes)
console.log('allRoutes', allRoutes, routes)
const router = new Router({
routes
})

View File

@ -82,8 +82,6 @@ export default {
methods: {
initData() {
if (!this.serverInfo) return
console.log('serverInfo', this.serverInfo)
this.version = this.serverInfo.version
this.bind_port = this.serverInfo.bind_port
this.bind_udp_port = this.serverInfo.bind_udp_port