From 76f4017470a2d5af8b0d17d16dc9ec9aeba650c4 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 25 Oct 2017 17:12:36 +0800 Subject: [PATCH 1/9] fix: fix getUserInfo by cookie bug --- src/mock/login.js | 2 +- src/permission.js | 2 ++ src/store/modules/user.js | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mock/login.js b/src/mock/login.js index 00ce9bde..5b00b503 100644 --- a/src/mock/login.js +++ b/src/mock/login.js @@ -34,7 +34,7 @@ export default { if (userMap[token]) { return userMap[token] } else { - return Promise.reject('error') + return false } }, logout: () => 'success' diff --git a/src/permission.js b/src/permission.js index b7ce9b6c..2fcc4c9c 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,6 +3,7 @@ import store from './store' import NProgress from 'nprogress' // Progress 进度条 import 'nprogress/nprogress.css'// Progress 进度条样式 import { getToken } from '@/utils/auth' // 验权 +import { Message } from 'element-ui' // permissiom judge function hasPermission(roles, permissionRoles) { @@ -29,6 +30,7 @@ router.beforeEach((to, from, next) => { }) }).catch(() => { store.dispatch('FedLogOut').then(() => { + Message.error('验证失败,请重新登录') next({ path: '/login' }) }) }) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 9c706978..0ac425e1 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -63,6 +63,9 @@ const user = { GetUserInfo({ commit, state }) { return new Promise((resolve, reject) => { getUserInfo(state.token).then(response => { + if (!response.data) { // 由于mockjs 不支持自定义状态码只能这样hack + reject('error') + } const data = response.data commit('SET_ROLES', data.role) commit('SET_NAME', data.name) From 913f6c8bec1471b35d700fdb141dc97ae8318647 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 25 Oct 2017 17:14:57 +0800 Subject: [PATCH 2/9] [release] 2.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 168afe35..a90197c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "juicy", - "version": "2.2.0", + "version": "2.2.1", "description": "A Vue.js admin", "author": "Pan ", "license": "MIT", From 74cbb26209f2c747444c8d31f0689dd45ddd7088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Tue, 31 Oct 2017 21:05:31 -0500 Subject: [PATCH 3/9] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0e0b96d3..05fa32c5 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,10 @@ **注意:该项目目前使用element-ui@1.4.2版本,所以最低兼容 Vue 2.3.0** + + Sponsor + + ## 前言 > 这半年来一直在用vue写管理后台,目前后台已经有百来个页面,十几种权限,但维护成本依然很低,所以准备开源分享一下后台开发的经验和成果。目前的技术栈主要的采用vue+element+axios由webpack2打包。由于是个人项目,所以数据请求都是用了mockjs模拟。注意:在此项目基础上改造开发时请移除mock文件。 From 660ff765f5f8ad29884a201e463ed68196bc94e8 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 1 Nov 2017 18:43:06 +0800 Subject: [PATCH 4/9] fix:fix tabsView path bug --- src/views/layout/TabsView.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/views/layout/TabsView.vue b/src/views/layout/TabsView.vue index 7f1eaa9f..e0ae6b6c 100644 --- a/src/views/layout/TabsView.vue +++ b/src/views/layout/TabsView.vue @@ -30,13 +30,16 @@ export default { $event.preventDefault() }, generateRoute() { - if (this.$route.matched[this.$route.matched.length - 1].name) { - return this.$route.matched[this.$route.matched.length - 1] + if (this.$route.name) { + return this.$route } - this.$route.matched[0].path = '/' - return this.$route.matched[0] + return false }, addViewTabs() { + const route = this.generateRoute() + if (!route) { + return false + } this.$store.dispatch('addVisitedViews', this.generateRoute()) }, isActive(path) { From a0d83e2ffcca486c7387f4c68faa97c233ee5a32 Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 10 Nov 2017 13:59:52 +0800 Subject: [PATCH 5/9] update:update echarts version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a90197c2..2723c6a4 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "clipboard": "1.7.1", "codemirror": "5.26.0", "dropzone": "5.1.0", - "echarts": "3.7.2", + "echarts": "3.8.2", "element-ui": "1.4.2", "file-saver": "1.3.3", "js-cookie": "2.1.4", From 925dbeb045bcadbaad1660d3190538c071e0a758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Tue, 14 Nov 2017 00:37:12 -0600 Subject: [PATCH 6/9] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 05fa32c5..34102b0c 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,7 @@ **注意:该项目目前使用element-ui@1.4.2版本,所以最低兼容 Vue 2.3.0** - - Sponsor - +楼主这里有一份调查[问卷](https://www.wjx.cn/m/16866569.aspx) 有空请填写一下,以表对本项目的支持~ps:不是给这个调查问卷网站做广告,所以填完问卷不用点上面抽奖有的没的那些东西 ## 前言 > 这半年来一直在用vue写管理后台,目前后台已经有百来个页面,十几种权限,但维护成本依然很低,所以准备开源分享一下后台开发的经验和成果。目前的技术栈主要的采用vue+element+axios由webpack2打包。由于是个人项目,所以数据请求都是用了mockjs模拟。注意:在此项目基础上改造开发时请移除mock文件。 From df28ad70782db74c8ec99b0b9d8a19f0ccc026b5 Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 28 Nov 2017 18:34:57 +0800 Subject: [PATCH 7/9] fix:fixed case-sensitive bug --- src/components/jsonEditor/index.vue | 64 ------------------- .../example/table/dynamictable/fixedThead.vue | 58 ----------------- .../example/table/dynamictable/index.vue | 19 ------ .../table/dynamictable/unfixedThead.vue | 47 -------------- 4 files changed, 188 deletions(-) delete mode 100644 src/components/jsonEditor/index.vue delete mode 100644 src/views/example/table/dynamictable/fixedThead.vue delete mode 100644 src/views/example/table/dynamictable/index.vue delete mode 100644 src/views/example/table/dynamictable/unfixedThead.vue diff --git a/src/components/jsonEditor/index.vue b/src/components/jsonEditor/index.vue deleted file mode 100644 index dcb5ee2d..00000000 --- a/src/components/jsonEditor/index.vue +++ /dev/null @@ -1,64 +0,0 @@ - - - - - diff --git a/src/views/example/table/dynamictable/fixedThead.vue b/src/views/example/table/dynamictable/fixedThead.vue deleted file mode 100644 index 5c088490..00000000 --- a/src/views/example/table/dynamictable/fixedThead.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - diff --git a/src/views/example/table/dynamictable/index.vue b/src/views/example/table/dynamictable/index.vue deleted file mode 100644 index 6182f0e7..00000000 --- a/src/views/example/table/dynamictable/index.vue +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/src/views/example/table/dynamictable/unfixedThead.vue b/src/views/example/table/dynamictable/unfixedThead.vue deleted file mode 100644 index a5991326..00000000 --- a/src/views/example/table/dynamictable/unfixedThead.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - From e00f2aedc7543060717a992c4642bdd1c592c9fe Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 28 Nov 2017 18:35:27 +0800 Subject: [PATCH 8/9] fix:fixed case-sensitive bug --- src/components/JsonEditor/index.vue | 64 +++++++++++++++++++ .../example/table/dynamicTable/fixedThead.vue | 58 +++++++++++++++++ .../example/table/dynamicTable/index.vue | 19 ++++++ .../table/dynamicTable/unfixedThead.vue | 47 ++++++++++++++ 4 files changed, 188 insertions(+) create mode 100644 src/components/JsonEditor/index.vue create mode 100644 src/views/example/table/dynamicTable/fixedThead.vue create mode 100644 src/views/example/table/dynamicTable/index.vue create mode 100644 src/views/example/table/dynamicTable/unfixedThead.vue diff --git a/src/components/JsonEditor/index.vue b/src/components/JsonEditor/index.vue new file mode 100644 index 00000000..dcb5ee2d --- /dev/null +++ b/src/components/JsonEditor/index.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/src/views/example/table/dynamicTable/fixedThead.vue b/src/views/example/table/dynamicTable/fixedThead.vue new file mode 100644 index 00000000..5c088490 --- /dev/null +++ b/src/views/example/table/dynamicTable/fixedThead.vue @@ -0,0 +1,58 @@ + + + + diff --git a/src/views/example/table/dynamicTable/index.vue b/src/views/example/table/dynamicTable/index.vue new file mode 100644 index 00000000..6182f0e7 --- /dev/null +++ b/src/views/example/table/dynamicTable/index.vue @@ -0,0 +1,19 @@ + + + + diff --git a/src/views/example/table/dynamicTable/unfixedThead.vue b/src/views/example/table/dynamicTable/unfixedThead.vue new file mode 100644 index 00000000..a5991326 --- /dev/null +++ b/src/views/example/table/dynamicTable/unfixedThead.vue @@ -0,0 +1,47 @@ + + + From 8f2b0c94ba9cbec959ba9a190c157dbfdac2a7d7 Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 28 Nov 2017 22:28:01 +0800 Subject: [PATCH 9/9] fix:fixed case-sensitive bug --- src/router/index.js | 2 +- src/views/components/jsonEditor.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index a4cc7b9b..f94f479b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -111,7 +111,7 @@ export const asyncRouterMap = [ name: 'Table', icon: 'table', children: [ - { path: 'dynamictable', component: _import('example/table/dynamictable/index'), name: '动态table' }, + { path: 'dynamictable', component: _import('example/table/dynamicTable/index'), name: '动态table' }, { path: 'dragtable', component: _import('example/table/dragTable'), name: '拖拽table' }, { path: 'inline_edit_table', component: _import('example/table/inlineEditTable'), name: 'table内编辑' }, { path: 'table', component: _import('example/table/table'), name: '综合table' } diff --git a/src/views/components/jsonEditor.vue b/src/views/components/jsonEditor.vue index f71c4378..693e09e0 100644 --- a/src/views/components/jsonEditor.vue +++ b/src/views/components/jsonEditor.vue @@ -8,7 +8,8 @@