From e90a9aea30ad4bde8531ffc8eaeb8a1051454edd Mon Sep 17 00:00:00 2001 From: OrangeM21 Date: Thu, 21 May 2020 20:43:50 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E4=BF=AE=E5=A4=8D=E5=B9=B3=E5=8F=B0Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 2 +- src/permission.js | 5 +- src/views/assets/Platform/Detail.vue | 49 ++++++++++++++++++-- src/views/assets/Platform/PlatformDetail.vue | 7 ++- 4 files changed, 54 insertions(+), 9 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index f2a4c1544..ce4168056 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -83,7 +83,7 @@ "GatewayCreate": "", "GatewayUpdate": "", "AdminUserUpdate": "", - "PlatformDetail": "", + "PlatformDetail": "平台详情", "CommandFilterRulesUpdate": "", "CommandFilterDetail": "命令过滤器详情", "AdminUserDetail": "管理用户详情", diff --git a/src/permission.js b/src/permission.js index 7574107cb..097eedf62 100644 --- a/src/permission.js +++ b/src/permission.js @@ -59,7 +59,7 @@ router.beforeEach(async(to, from, next) => { // note: roles must be a object array! such as: ['admin'] or ,['developer','editor'] 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 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') // next(`/login?redirect=${to.path}`) // NProgress.done() + console.log(error) next() } }) @@ -88,7 +89,7 @@ router.afterEach(() => { NProgress.done() }) -function checkRoules(val) { +function checkRoles(val) { let currentRule = getPermission() if (currentRule) { if (!val.includes(currentRule)) { diff --git a/src/views/assets/Platform/Detail.vue b/src/views/assets/Platform/Detail.vue index 0746029d9..9eed0c9d3 100644 --- a/src/views/assets/Platform/Detail.vue +++ b/src/views/assets/Platform/Detail.vue @@ -1,13 +1,54 @@ diff --git a/src/views/assets/Platform/PlatformDetail.vue b/src/views/assets/Platform/PlatformDetail.vue index 6400bc073..a850690b9 100644 --- a/src/views/assets/Platform/PlatformDetail.vue +++ b/src/views/assets/Platform/PlatformDetail.vue @@ -19,20 +19,23 @@ export default { return { TaskDetail: {}, actions: { - detailApiUrl: 'api/v1/assets/platform/details/1/' + detailApiUrl: `/api/v1/assets/platforms/${this.$route.params.id}/` }, config: { title: this.$t('assets.commandFilterDetail'), activeMenu: 'Detail', submenu: [ { - title: this.$t('assets.detail'), + title: this.$t('assets.PlatformDetail'), name: 'Detail' } ], hasRightSide: false } } + }, + computed: { + } }