mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-02 11:58:01 +08:00
新增几个路由配置
This commit is contained in:
parent
129dc2b5e0
commit
d6fbdb528e
@ -1,5 +1,6 @@
|
||||
import axios from './config';
|
||||
|
||||
// 获取系统菜单列表
|
||||
export function getSystemMenu() {
|
||||
return axios({
|
||||
url: 'menus_data.json',
|
||||
|
@ -9,7 +9,7 @@ export function login(params) {
|
||||
})
|
||||
}
|
||||
|
||||
// 修改昵称
|
||||
// 修改密码
|
||||
export function updatePwd(params) {
|
||||
return axios({
|
||||
url: '/user/updatePwd',
|
||||
|
12
web-vue/src/pages/404/index.vue
Normal file
12
web-vue/src/pages/404/index.vue
Normal file
@ -0,0 +1,12 @@
|
||||
<template>
|
||||
<div>404</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -18,7 +18,7 @@
|
||||
<a-layout-content
|
||||
:style="{ margin: '24px 16px', padding: '24px', background: '#fff', minHeight: '280px' }"
|
||||
>
|
||||
Content
|
||||
<router-view/>
|
||||
</a-layout-content>
|
||||
</a-layout>
|
||||
</a-layout>
|
||||
|
@ -5,18 +5,20 @@
|
||||
<a-icon type="apartment" />
|
||||
<span>{{menu.title}}</span>
|
||||
</span>
|
||||
<a-menu-item v-for="subMenu in menu.childs" :key="subMenu.id">
|
||||
<a-menu-item v-for="subMenu in menu.childs" :key="subMenu.id" @click="handleClick(subMenu.url)">
|
||||
<span>{{subMenu.title}}</span>
|
||||
</a-menu-item>
|
||||
</a-sub-menu>
|
||||
|
||||
</a-menu>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import routeMenuList from '../../router/route-menu';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
routeList: routeMenuList
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -27,6 +29,17 @@ export default {
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 匹配路由和菜单
|
||||
checkRouteMenu(id) {
|
||||
const tempList = this.routeList.filter(route => {
|
||||
return route.id === id;
|
||||
})
|
||||
return tempList.length > 0;
|
||||
},
|
||||
handleClick(path) {
|
||||
console.log(path)
|
||||
this.$router.push(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
12
web-vue/src/pages/node/list.vue
Normal file
12
web-vue/src/pages/node/list.vue
Normal file
@ -0,0 +1,12 @@
|
||||
<template>
|
||||
<div>Node List</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,5 +1,6 @@
|
||||
import Vue from 'vue';
|
||||
import Router from 'vue-router';
|
||||
import routeMenuList from './route-menu';
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
@ -14,7 +15,13 @@ export default new Router({
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: () => import('../pages/layout')
|
||||
component: () => import('../pages/layout'),
|
||||
children: routeMenuList
|
||||
},
|
||||
{
|
||||
path: '*',
|
||||
name: '404',
|
||||
component: () => import('../pages/404')
|
||||
}
|
||||
]
|
||||
})
|
||||
|
18
web-vue/src/router/route-menu.js
Normal file
18
web-vue/src/router/route-menu.js
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* 路由菜单
|
||||
* id 是后台菜单指定的 id
|
||||
*/
|
||||
const routeMenuList = [
|
||||
{
|
||||
path: '/node/list',
|
||||
name: 'node-list',
|
||||
component: () => import('../pages/node/list')
|
||||
},
|
||||
{
|
||||
path: '/node/ssh',
|
||||
name: 'node-ssh',
|
||||
component: () => import('../pages/node/list')
|
||||
}
|
||||
]
|
||||
|
||||
export default routeMenuList
|
Loading…
Reference in New Issue
Block a user