update acl

This commit is contained in:
pycook
2019-11-14 18:35:31 +08:00
parent 3b62bd7ac9
commit 0439e2462b
21 changed files with 329 additions and 221 deletions

View File

@@ -9,6 +9,6 @@ const api = {
SendSms: '/account/sms',
SendSmsErr: '/account/sms_err',
// get my info
UserInfo: '/v1/perms/user/info'
UserInfo: '/v1/acl/users/info'
}
export default api

View File

@@ -1,12 +1,17 @@
<template>
<div class="user-wrapper">
<div class="content-box">
<a href="https://github.com/pycook/cmdb" target="_blank">
<span class="action">
源代码 -> <a-icon type="github" style="font-size: 20px; color: #002140"></a-icon>
</span>
</a>
<!-- <a href="https://pro.loacg.com/docs/getting-started" target="_blank">
<span class="action">
<a-icon type="question-circle-o"></a-icon>
</span>
</a> -->
<!-- <notice-icon class="action"/> -->
</a>
<notice-icon class="action"/> -->
<a-dropdown>
<span class="action ant-dropdown-link user-dropdown-menu">
<a-avatar class="avatar" size="small" :src="avatar()"/>
@@ -25,10 +30,6 @@
<span>账户设置</span>
</router-link>
</a-menu-item>
<a-menu-item key="2" disabled>
<a-icon type="setting"/>
<span>测试</span>
</a-menu-item>
<a-menu-divider/> -->
<a-menu-item key="3">
<a href="javascript:;" @click="handleLogout">

View File

@@ -65,6 +65,36 @@ const cmdbRouter = [
meta: { title: '属性库', keepAlive: true }
}
]
},
{
path: '/acl',
name: 'cmdb_acl',
component: RouteView,
redirect: '/acl/users',
meta: { title: '权限管理', icon: 'safety-certificate', permission: ['admin'] },
children: [
{
path: '/acl/users',
name: 'acl_users',
hideChildrenInMenu: true,
component: () => import('@/views/cmdb/acl/users'),
meta: { title: 'Users', keepAlive: true }
},
{
path: '/acl/roles',
name: 'acl_roles',
hideChildrenInMenu: true,
component: () => import('@/views/cmdb/acl/roles'),
meta: { title: 'Roles', keepAlive: true }
},
{
path: '/acl/resources',
name: 'acl_resources',
hideChildrenInMenu: true,
component: () => import('@/views/cmdb/acl/resources'),
meta: { title: 'Resources', keepAlive: true }
}
]
}
]

View File

@@ -1,7 +1,6 @@
import Vue from 'vue'
import axios from 'axios'
import store from '@/store'
import notification from 'ant-design-vue/es/notification'
import { VueAxios } from './axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
@@ -15,13 +14,6 @@ const service = axios.create({
const err = (error) => {
if (error.response) {
const data = error.response.data
if (error.response.status === 403) {
notification.error({
message: 'Forbidden',
description: data.message
})
}
if (error.response.status === 401) {
store.dispatch('Logout')
}

View File

@@ -0,0 +1,10 @@
<template>
<div></div>
</template>
<script>
export default {}
</script>
<style>
</style>

View File

@@ -0,0 +1,10 @@
<template>
<div></div>
</template>
<script>
export default {}
</script>
<style>
</style>

View File

@@ -0,0 +1,10 @@
<template>
<div></div>
</template>
<script>
export default {}
</script>
<style>
</style>