From c0d3fbb47a3cc6bb3b64fd2efd062d9271cf97d7 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 5 Nov 2020 18:59:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9D=83=E9=99=90?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E9=97=AE=E9=A2=98=20(#482)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复权限认证问题 * fix: 修复权限认证问题 Co-authored-by: Orange --- src/router/perms.js | 2 +- .../DatabaseApp/DatabaseAppList.vue | 22 +++++++++---------- src/views/perms/const.js | 22 +++++++++---------- src/views/settings/License.vue | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/router/perms.js b/src/router/perms.js index 799546400..e021537e6 100644 --- a/src/router/perms.js +++ b/src/router/perms.js @@ -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: [ { diff --git a/src/views/applications/DatabaseApp/DatabaseAppList.vue b/src/views/applications/DatabaseApp/DatabaseAppList.vue index fbe19a4a3..8fc06d44e 100644 --- a/src/views/applications/DatabaseApp/DatabaseAppList.vue +++ b/src/views/applications/DatabaseApp/DatabaseAppList.vue @@ -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 } } } diff --git a/src/views/perms/const.js b/src/views/perms/const.js index bd7f81747..37acec667 100644 --- a/src/views/perms/const.js +++ b/src/views/perms/const.js @@ -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 }}) } } ] diff --git a/src/views/settings/License.vue b/src/views/settings/License.vue index 8d59853f1..ec0881bcd 100644 --- a/src/views/settings/License.vue +++ b/src/views/settings/License.vue @@ -83,7 +83,7 @@ export default { if (this.publicSettings.XPACK_ENABLED) { return this.publicSettings.XPACK_LICENSE_IS_VALID } - return true + return false }, cardTitle() { return ''