From 66208baf14a33e5cbe615a6b773c1dd0b95a9b25 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 9 Jun 2020 16:10:35 +0800 Subject: [PATCH] some correct --- client/src/utils/index.js | 2 +- client/src/utils/request.js | 3 +- client/src/views/system/dict.vue | 14 ++-- client/src/views/system/organization.vue | 10 +-- client/src/views/system/perm.vue | 6 +- client/src/views/system/role.vue | 10 +-- .../migrations/0011_auto_20200609_1549.py | 72 ++++++++++++++++++ server/apps/system/mixins.py | 2 +- server/apps/system/models.py | 22 +++--- server/apps/system/permission.py | 16 ++-- server/apps/system/permission_data.py | 36 ++++----- server/apps/system/views.py | 6 +- server/requirements.txt | Bin 2336 -> 2336 bytes server/utils/pagination.py | 6 ++ server/utils/queryset.py | 12 +-- server/utils/serializer.py | 62 +++++++-------- 16 files changed, 178 insertions(+), 101 deletions(-) create mode 100644 server/apps/system/migrations/0011_auto_20200609_1549.py create mode 100644 server/utils/pagination.py diff --git a/client/src/utils/index.js b/client/src/utils/index.js index cfdf23c..5c35ba4 100644 --- a/client/src/utils/index.js +++ b/client/src/utils/index.js @@ -361,7 +361,7 @@ export function genTree(data) { map[item.id] = item }) data.forEach(item => { - const parent = map[item.pid] + const parent = map[item.parent] if (parent) { (parent.children || (parent.children = [])).push(item) } else { diff --git a/client/src/utils/request.js b/client/src/utils/request.js index a8533cb..484e177 100644 --- a/client/src/utils/request.js +++ b/client/src/utils/request.js @@ -60,8 +60,7 @@ service.interceptors.response.use( type: 'error', duration: 5 * 1000 }) - - // return Promise.reject(new Error(res.error || '请求出错')) + return Promise.reject(new Error(res.msg || '请求出错')) } else { return res } diff --git a/client/src/views/system/dict.vue b/client/src/views/system/dict.vue index 2c56ee5..f3b5926 100644 --- a/client/src/views/system/dict.vue +++ b/client/src/views/system/dict.vue @@ -63,7 +63,7 @@ - +