- 添加 mock 数据

This commit is contained in:
sin 2019-03-05 21:35:29 +08:00
parent a9168ec6ac
commit 10a1f83c8e
2 changed files with 69 additions and 0 deletions

View File

@ -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,
};

View File

@ -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
}
]
}
]
}