mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-28 19:32:01 +00:00
fix: 修复权限认证问题 (#482)
* fix: 修复权限认证问题 * fix: 修复权限认证问题 Co-authored-by: Orange <orangemtony@gmail.com>
This commit is contained in:
parent
09075b13b7
commit
c0d3fbb47a
@ -35,7 +35,7 @@ const ApplicationPermissionRoutes = [
|
||||
{
|
||||
path: 'app-permissions',
|
||||
component: empty,
|
||||
meta: { title: i18n.t('route.ApplicationPermission'), licenseRequired: true },
|
||||
meta: { title: i18n.t('route.ApplicationPermission') },
|
||||
redirect: '',
|
||||
children: [
|
||||
{
|
||||
|
@ -62,28 +62,28 @@ export default {
|
||||
name: 'MySQL',
|
||||
title: 'MySQL',
|
||||
type: 'primary',
|
||||
can: true,
|
||||
has: true,
|
||||
callback: this.createMysql.bind(this)
|
||||
},
|
||||
{
|
||||
name: 'PostgreSQL',
|
||||
title: 'PostgreSQL',
|
||||
type: 'primary',
|
||||
can: this.isValidateLicense,
|
||||
has: this.isValidateLicense,
|
||||
callback: this.createPostgreSQL.bind(this)
|
||||
},
|
||||
{
|
||||
name: 'MariaDB',
|
||||
title: 'MariaDB',
|
||||
type: 'primary',
|
||||
can: this.isValidateLicense,
|
||||
has: this.isValidateLicense,
|
||||
callback: this.createMariaDB.bind(this)
|
||||
},
|
||||
{
|
||||
name: 'Oracle',
|
||||
title: 'Oracle',
|
||||
type: 'primary',
|
||||
can: this.isValidateLicense,
|
||||
has: this.isValidateLicense,
|
||||
callback: this.createOracle.bind(this)
|
||||
}
|
||||
]
|
||||
@ -91,13 +91,7 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['publicSettings', 'currentOrg']),
|
||||
isValidateLicense() {
|
||||
if (this.publicSettings.XPACK_ENABLED) {
|
||||
return this.publicSettings.XPACK_LICENSE_IS_VALID
|
||||
}
|
||||
return true
|
||||
}
|
||||
...mapGetters(['publicSettings', 'currentOrg'])
|
||||
},
|
||||
methods: {
|
||||
createMysql() {
|
||||
@ -111,6 +105,12 @@ export default {
|
||||
},
|
||||
createOracle() {
|
||||
this.$router.push({ name: 'DatabaseAppCreate', query: { type: 'oracle' }})
|
||||
},
|
||||
isValidateLicense() {
|
||||
if (this.publicSettings.XPACK_ENABLED) {
|
||||
return this.publicSettings.XPACK_LICENSE_IS_VALID
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ function isValidateLicense() {
|
||||
if (store.getters.publicSettings.XPACK_ENABLED) {
|
||||
return store.getters.publicSettings.XPACK_LICENSE_IS_VALID
|
||||
}
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
export const REMOTE_APP = [
|
||||
@ -19,28 +19,28 @@ export const REMOTE_APP = [
|
||||
name: CHROME,
|
||||
title: i18n.t(`applications.applicationsType.${CHROME}`),
|
||||
type: 'primary',
|
||||
can: isValidateLicense,
|
||||
has: isValidateLicense,
|
||||
callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: CHROME, category: REMOTEAPP_CATEGORY }}) }
|
||||
},
|
||||
{
|
||||
name: MYSQL_WORKBENCH,
|
||||
title: i18n.t(`applications.applicationsType.${MYSQL_WORKBENCH}`),
|
||||
type: 'primary',
|
||||
can: isValidateLicense,
|
||||
has: isValidateLicense,
|
||||
callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: MYSQL_WORKBENCH, category: REMOTEAPP_CATEGORY }}) }
|
||||
},
|
||||
{
|
||||
name: VMWARE_CLIENT,
|
||||
title: i18n.t(`applications.applicationsType.${VMWARE_CLIENT}`),
|
||||
type: 'primary',
|
||||
can: isValidateLicense,
|
||||
has: isValidateLicense,
|
||||
callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: VMWARE_CLIENT, category: REMOTEAPP_CATEGORY }}) }
|
||||
},
|
||||
{
|
||||
name: CUSTOM,
|
||||
title: i18n.t(`applications.applicationsType.${CUSTOM}`),
|
||||
type: 'primary',
|
||||
can: isValidateLicense,
|
||||
has: isValidateLicense,
|
||||
callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: CUSTOM, category: REMOTEAPP_CATEGORY }}) }
|
||||
}
|
||||
]
|
||||
@ -56,29 +56,29 @@ export const DATABASE = [
|
||||
name: MYSQL,
|
||||
title: i18n.t(`applications.applicationsType.${MYSQL}`),
|
||||
type: 'primary',
|
||||
can: true,
|
||||
divided: true,
|
||||
has: true,
|
||||
divided: isValidateLicense,
|
||||
callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: MYSQL, category: DATABASE_CATEGORY }}) }
|
||||
},
|
||||
{
|
||||
name: ORACLE,
|
||||
title: i18n.t(`applications.applicationsType.${ORACLE}`),
|
||||
type: 'primary',
|
||||
can: isValidateLicense,
|
||||
has: isValidateLicense,
|
||||
callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: ORACLE, category: DATABASE_CATEGORY }}) }
|
||||
},
|
||||
{
|
||||
name: POSTGRESQL,
|
||||
title: i18n.t(`applications.applicationsType.${POSTGRESQL}`),
|
||||
type: 'primary',
|
||||
can: isValidateLicense,
|
||||
has: isValidateLicense,
|
||||
callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: POSTGRESQL, category: DATABASE_CATEGORY }}) }
|
||||
},
|
||||
{
|
||||
name: MARIADB,
|
||||
title: i18n.t(`applications.applicationsType.${MARIADB}`),
|
||||
type: 'primary',
|
||||
can: isValidateLicense,
|
||||
has: isValidateLicense,
|
||||
callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: MARIADB, category: DATABASE_CATEGORY }}) }
|
||||
}
|
||||
]
|
||||
@ -92,7 +92,7 @@ export const CLOUD = [
|
||||
title: i18n.t(`applications.applicationsType.${KUBERNETES}`),
|
||||
divided: true,
|
||||
type: 'primary',
|
||||
can: true,
|
||||
has: true,
|
||||
callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: KUBERNETES, category: CLOUD_CATEGORY }}) }
|
||||
}
|
||||
]
|
||||
|
@ -83,7 +83,7 @@ export default {
|
||||
if (this.publicSettings.XPACK_ENABLED) {
|
||||
return this.publicSettings.XPACK_LICENSE_IS_VALID
|
||||
}
|
||||
return true
|
||||
return false
|
||||
},
|
||||
cardTitle() {
|
||||
return ''
|
||||
|
Loading…
Reference in New Issue
Block a user