diff --git a/nezha-fronted/src/components/page/config/operationRecord.vue b/nezha-fronted/src/components/page/config/operationRecord.vue index 77bccf339..d91bd6e0c 100644 --- a/nezha-fronted/src/components/page/config/operationRecord.vue +++ b/nezha-fronted/src/components/page/config/operationRecord.vue @@ -69,9 +69,9 @@ export default { disabled: false }, { id: 12, - name: this.$t('config.operationlog.username'), + name: this.$t('config.operationlog.userId'), type: 'input', - label: 'username', + label: 'userId', disabled: false }, { id: 13, @@ -133,6 +133,7 @@ export default { color: #666666; letter-spacing: 0; font-weight: 400; + cursor: pointer; opacity: .6; transform: translateX(20%); } diff --git a/nezha-fronted/src/permission.js b/nezha-fronted/src/permission.js index 9040f7227..b8f89193e 100644 --- a/nezha-fronted/src/permission.js +++ b/nezha-fronted/src/permission.js @@ -26,36 +26,34 @@ router.beforeEach((to, from, next) => { }) }) } else if (sessionStorage.getItem('nz-token')) { - if (permissionWhiteList.indexOf(to.path) !== -1) { - next() - } else { - new Promise(resolve => { - if (store.getters.menuList.length === 0) { - const configUrl = 'static/config.json?Timestamp=' + new Date().getTime() - Vue.http.get(configUrl).then(config => { - post(config.body.baseUrl + 'sys/user/permissions', { token: sessionStorage.getItem('nz-token') }).then(res => { - store.commit('setMenuList', sortByOrderNum(res.data.menus)) - store.commit('setButtonList', res.data.buttons) - store.commit('setRoleList', res.data.roles) - resolve() - }) + new Promise(resolve => { + if (store.getters.menuList.length === 0) { + const configUrl = 'static/config.json?Timestamp=' + new Date().getTime() + Vue.http.get(configUrl).then(config => { + post(config.body.baseUrl + 'sys/user/permissions', { token: sessionStorage.getItem('nz-token') }).then(res => { + store.commit('setMenuList', sortByOrderNum(res.data.menus)) + store.commit('setButtonList', res.data.buttons) + store.commit('setRoleList', res.data.roles) + resolve() }) + }) + } else { + resolve() + } + }).then(res => { + if (to.path) { + if (permissionWhiteList.indexOf(to.path) !== -1) { + next() + } else if (hasMenu(store.getters.menuList, to.path)) { + next() } else { - resolve() - } - }).then(res => { - if (to.path) { - if (hasMenu(store.getters.menuList, to.path)) { - next() - } else { - if (to.path === '/monitor/monitor/project' || to.path === '/monitor/monitor/module' || to.path === '/monitor/monitor/endpoint') { - return - } - ElementUI.Message.error(i18n.t('tip.noAccess')) + if (to.path === '/monitor/monitor/project' || to.path === '/monitor/monitor/module' || to.path === '/monitor/monitor/endpoint') { + return } + ElementUI.Message.error(i18n.t('tip.noAccess')) } - }) - } + } + }) } else { if (loginWhiteList.indexOf(to.path) !== -1) { next()