diff --git a/admin-web/mock/admin.js b/admin-web/mock/admin.js index 1a201cff3..1945f0162 100644 --- a/admin-web/mock/admin.js +++ b/admin-web/mock/admin.js @@ -1,6 +1,7 @@ import adminMenu from './geographic/admin-menu.json'; import adminMenuAll from './geographic/admin-menu-all.json'; import adminUrls from './geographic/admin-urls'; +import resourceTree from './geographic/resource-tree.json'; /* eslint-disable */ function getAdminMenu(req, res) { @@ -15,7 +16,12 @@ function getAdminUrls(req, res) { return res.json(adminUrls); } +function getResourceTree(req, res) { + return res.json(resourceTree); +} + export default { 'GET /admin-api/admin/resource/admin_menu_tree': getAdminMenuAll, 'GET /admin-api/admin/resource/admin_url_list': getAdminUrls, + 'GET /admin-api/admin/resource/tree': getResourceTree, }; diff --git a/admin-web/mock/geographic/resource-tree.json b/admin-web/mock/geographic/resource-tree.json new file mode 100644 index 000000000..57dcebd24 --- /dev/null +++ b/admin-web/mock/geographic/resource-tree.json @@ -0,0 +1,63 @@ +{ + "code": 0, + "message": "", + "data": [ + { + "id": 1, + "name": "admin_info", + "type": 2, + "sort": -1, + "displayName": "管理员信息(The mock data)", + "createTime": 1551020863000, + "pid": 0, + "handler": "/admin/admin/info", + "children": null + }, + { + "id": 2, + "name": "product", + "type": 1, + "sort": 1, + "displayName": "商品", + "createTime": 1551062423000, + "pid": 0, + "handler": "", + "children": [ + { + "id": 3, + "name": "product_manager", + "type": 1, + "sort": 1, + "displayName": "商品管理", + "createTime": 1551332076000, + "pid": 2, + "handler": "/product/list", + "children": null + } + ] + }, + { + "id": 9, + "name": "测试菜单1", + "type": 1, + "sort": 1, + "displayName": "测试说明", + "createTime": 1551371637000, + "pid": 0, + "handler": null, + "children": [ + { + "id": 11, + "name": "测试", + "type": 1, + "sort": 1, + "displayName": "测试", + "createTime": 1551791053000, + "pid": 9, + "handler": "/admin/test", + "children": null + } + ] + } + ] +}