mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-24 04:33:06 +00:00
[fix]修复平台Bug
This commit is contained in:
@@ -83,7 +83,7 @@
|
|||||||
"GatewayCreate": "",
|
"GatewayCreate": "",
|
||||||
"GatewayUpdate": "",
|
"GatewayUpdate": "",
|
||||||
"AdminUserUpdate": "",
|
"AdminUserUpdate": "",
|
||||||
"PlatformDetail": "",
|
"PlatformDetail": "平台详情",
|
||||||
"CommandFilterRulesUpdate": "",
|
"CommandFilterRulesUpdate": "",
|
||||||
"CommandFilterDetail": "命令过滤器详情",
|
"CommandFilterDetail": "命令过滤器详情",
|
||||||
"AdminUserDetail": "管理用户详情",
|
"AdminUserDetail": "管理用户详情",
|
||||||
|
@@ -59,7 +59,7 @@ router.beforeEach(async(to, from, next) => {
|
|||||||
// note: roles must be a object array! such as: ['admin'] or ,['developer','editor']
|
// note: roles must be a object array! such as: ['admin'] or ,['developer','editor']
|
||||||
let { current_org_roles } = await store.dispatch('users/getProfile')
|
let { current_org_roles } = await store.dispatch('users/getProfile')
|
||||||
|
|
||||||
current_org_roles = checkRoules(current_org_roles)
|
current_org_roles = checkRoles(current_org_roles)
|
||||||
|
|
||||||
// generate accessible routes map based on roles
|
// generate accessible routes map based on roles
|
||||||
const accessRoutes = await store.dispatch('permission/generateRoutes', current_org_roles)
|
const accessRoutes = await store.dispatch('permission/generateRoutes', current_org_roles)
|
||||||
@@ -79,6 +79,7 @@ router.beforeEach(async(to, from, next) => {
|
|||||||
// Message.error(error || 'Has Error')
|
// Message.error(error || 'Has Error')
|
||||||
// next(`/login?redirect=${to.path}`)
|
// next(`/login?redirect=${to.path}`)
|
||||||
// NProgress.done()
|
// NProgress.done()
|
||||||
|
console.log(error)
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -88,7 +89,7 @@ router.afterEach(() => {
|
|||||||
NProgress.done()
|
NProgress.done()
|
||||||
})
|
})
|
||||||
|
|
||||||
function checkRoules(val) {
|
function checkRoles(val) {
|
||||||
let currentRule = getPermission()
|
let currentRule = getPermission()
|
||||||
if (currentRule) {
|
if (currentRule) {
|
||||||
if (!val.includes(currentRule)) {
|
if (!val.includes(currentRule)) {
|
||||||
|
@@ -1,13 +1,54 @@
|
|||||||
<template>
|
<template>
|
||||||
<div />
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="14">
|
||||||
|
<DetailCard :items="detailCardItems" />
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="10" />
|
||||||
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import DetailCard from '@/components/DetailCard'
|
||||||
export default {
|
export default {
|
||||||
name: '',
|
name: 'Detail',
|
||||||
components: {},
|
components: {
|
||||||
|
DetailCard
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
object: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {}
|
return {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
detailCardItems() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
key: this.$t('assets.Name'),
|
||||||
|
value: this.object.name
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: this.$t('assets.BasePlatform'),
|
||||||
|
value: this.object.base
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: this.$t('assets.Charset'),
|
||||||
|
value: this.object.charset
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: this.$t('assets.Meta'),
|
||||||
|
value: this.object.meta
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: this.$t('assets.Comment'),
|
||||||
|
value: this.object.comment
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@@ -19,20 +19,23 @@ export default {
|
|||||||
return {
|
return {
|
||||||
TaskDetail: {},
|
TaskDetail: {},
|
||||||
actions: {
|
actions: {
|
||||||
detailApiUrl: 'api/v1/assets/platform/details/1/'
|
detailApiUrl: `/api/v1/assets/platforms/${this.$route.params.id}/`
|
||||||
},
|
},
|
||||||
config: {
|
config: {
|
||||||
title: this.$t('assets.commandFilterDetail'),
|
title: this.$t('assets.commandFilterDetail'),
|
||||||
activeMenu: 'Detail',
|
activeMenu: 'Detail',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
title: this.$t('assets.detail'),
|
title: this.$t('assets.PlatformDetail'),
|
||||||
name: 'Detail'
|
name: 'Detail'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
hasRightSide: false
|
hasRightSide: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user