diff --git a/src/api/system/dept.js b/src/api/system/dept.js index 8877b53..d5b2736 100644 --- a/src/api/system/dept.js +++ b/src/api/system/dept.js @@ -9,7 +9,7 @@ export function getDepts(params) { }) } -export function getSuperior(ids) { +export function getDeptSuperior(ids) { const params = { ids: ids } @@ -43,4 +43,4 @@ export function edit(data) { }) } -export default { add, edit, del, getDepts, getSuperior } +export default { add, edit, del, getDepts, getDeptSuperior } diff --git a/src/api/system/menu.js b/src/api/system/menu.js index f9888a7..6e7eae0 100644 --- a/src/api/system/menu.js +++ b/src/api/system/menu.js @@ -1,4 +1,5 @@ import request from '@/utils/request' +import qs from 'qs' export function getMenusTree(pid) { return request({ @@ -15,9 +16,12 @@ export function getMenus(params) { }) } -export function getSuperior(id) { +export function getMenuSuperior(ids) { + const params = { + ids: ids + } return request({ - url: 'api/menus/superior?id=' + id, + url: 'api/menus/superior?' + qs.stringify(params, { indices: false }), method: 'get' }) } @@ -53,4 +57,4 @@ export function edit(data) { }) } -export default { add, edit, del, getMenusTree, getSuperior, getMenus } +export default { add, edit, del, getMenusTree, getMenuSuperior, getMenus } diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 9cbc25e..7fee6ee 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -174,7 +174,7 @@ export default { } }, getSupDepts(id) { - crudDept.getSuperior(id).then(res => { + crudDept.getDeptSuperior(id).then(res => { this.depts = res.content.map(function(obj) { if (obj.hasChildren && !obj.children) { obj.children = null diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index b3174ec..1f0e689 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -221,8 +221,8 @@ export default { }, 100) }, getSupDepts(id) { - crudMenu.getSuperior(id).then(res => { - const children = res.content.map(function(obj) { + crudMenu.getMenuSuperior(id).then(res => { + const children = res.map(function(obj) { if (!obj.leaf && !obj.children) { obj.children = null } diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index e6acb00..cbb2434 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -128,8 +128,8 @@