diff --git a/client/src/router/index.js b/client/src/router/index.js index 7ad22f6..a2c7ee5 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -31,11 +31,6 @@ import Layout from '@/layout' * all perms can be accessed */ export const constantRoutes = [ - { - path: '/login', - component: () => import('@/views/login/index'), - hidden: true - }, { path: '/', component: Layout, @@ -47,6 +42,16 @@ export const constantRoutes = [ meta: { title: '首页', icon: 'dashboard' } }] }, + { + path: '/login', + component: () => import('@/views/login/index'), + hidden: true + }, + { + path: '/404', + component: () => import('@/views/404'), + hidden: true + }, { path: '/myinfo', component: Layout, @@ -248,21 +253,22 @@ export const asyncRoutes = [ } ] }, - { path: '*', redirect: '/404', hidden: true } -] - -const createRouter = () => new Router({ - // mode: 'history', // require service support - scrollBehavior: () => ({ y: 0 }), - routes: constantRoutes -}) - -const router = createRouter() - -// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 -export function resetRouter() { - const newRouter = createRouter() - router.matcher = newRouter.matcher // reset router -} - -export default router + // 404 page must be placed at the end !!! + { path: '*', redirect: '/404', hidden: true } + ] + + const createRouter = () => new Router({ + // mode: 'history', // require service support + scrollBehavior: () => ({ y: 0 }), + routes: constantRoutes + }) + + const router = createRouter() + + // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 + export function resetRouter() { + const newRouter = createRouter() + router.matcher = newRouter.matcher // reset router + } + + export default router \ No newline at end of file diff --git a/client/src/store/modules/user.js b/client/src/store/modules/user.js index a886ba6..c62c6b7 100644 --- a/client/src/store/modules/user.js +++ b/client/src/store/modules/user.js @@ -95,18 +95,22 @@ const actions = { return new Promise((resolve, reject) => { getInfo(state.token).then(response => { const { data } = response + + if (!data) { + reject('验证失败,重新登陆.') + } + const { perms, name, avatar } = data + // perms must be a non-empty array if (!perms || perms.length <= 0) { reject('没有任何权限!') } + commit('SET_PERMS', perms) commit('SET_NAME', name) commit('SET_AVATAR', avatar) resolve(data) - - - }).catch(error => { reject(error) }) diff --git a/client/src/views/ability/cma2.vue b/client/src/views/ability/cma2.vue index a959787..b7c9451 100644 --- a/client/src/views/ability/cma2.vue +++ b/client/src/views/ability/cma2.vue @@ -406,7 +406,6 @@ export default { this.multipleSelection = val; }, filterChange(obj) { - console.log(obj) for (let key in obj) { this.listQuery[key] = obj[key][0]; } diff --git a/client/src/views/ability/inspection.vue b/client/src/views/ability/inspection.vue index 2cdc02f..c64fd57 100644 --- a/client/src/views/ability/inspection.vue +++ b/client/src/views/ability/inspection.vue @@ -256,7 +256,6 @@ export default { }, getList() { this.listLoading = true; - console.log(this.listQuery) getInspectionList(this.listQuery).then((response) => { if (response.data) { this.istList = response.data; @@ -272,7 +271,6 @@ export default { data.group_by = key; getInspectionGroup(data).then((response) => { this.groupBy[key] = response.data; - console.log(this.groupBy); }); } }, diff --git a/client/src/views/dashboard/index.vue b/client/src/views/dashboard/index.vue index f77b6d9..913477d 100644 --- a/client/src/views/dashboard/index.vue +++ b/client/src/views/dashboard/index.vue @@ -58,7 +58,7 @@
待办任务提醒
-
+
您有 {{todos.toup}} @@ -66,13 +66,13 @@
- + 您有 {{todos.tozg}} 条记录待整改
-
+
您有 {{todos.toconfirm}} diff --git a/client/src/views/supervision/recorddo.vue b/client/src/views/supervision/recorddo.vue index f248d02..419455b 100644 --- a/client/src/views/supervision/recorddo.vue +++ b/client/src/views/supervision/recorddo.vue @@ -175,7 +175,6 @@ export default { }, deleteFile(index){ this.$confirm('确定删除该文件, 是否继续?', {type:'error'}).then(() => { - console.log(index) this.fileList.splice(index) }).catch(e=>{}) }, diff --git a/client/src/views/system/user.vue b/client/src/views/system/user.vue index c36f263..401056f 100644 --- a/client/src/views/system/user.vue +++ b/client/src/views/system/user.vue @@ -394,7 +394,7 @@ export default { this.$message.success("成功"); }) .catch((err) => { - console.error(err); + }); }, async confirm(form) {