新增模块
- Nav 模型(applications/models/admin_nav.py):公开导航表,与 admin_power 解耦
- NavOutSchema / NavManageSchema(applications/schemas/admin_nav.py)
- 前台公开视图 applications/view/public/nav.py:/site/、/site/category/<name>、/site/api/navs,无需登录
- 后台管理视图 applications/view/system/nav.py:CRUD + 启用/禁用,挂入 system_bp
- 前台模板 templates/public/{base,index,category}.html(独立配色,无需登录即可访问)
- 后台模板 templates/system/nav/{main,add,edit}.html(Layui table + form)
调整
- applications/view/__init__.py:注册前台蓝图到根
- applications/view/system/__init__.py:注册后台 nav 子蓝图
- applications/common/script/admin.py:admin init/export 支持 navs 数组
- applications/common/script/app_data/init.json:新增 10 条导航种子 + 4 条 system:nav 权限
数据库
- 新增 public_nav 表(含 category 索引)
- migration: 38751d88d42c_add_public_nav_table.py
718 lines
17 KiB
JSON
718 lines
17 KiB
JSON
{
|
|
"depts": [
|
|
{
|
|
"id": 1,
|
|
"parent_id": 0,
|
|
"dept_name": "总公司",
|
|
"sort": 1,
|
|
"leader": "就眠仪式",
|
|
"phone": "12312345679",
|
|
"email": "123qq.com",
|
|
"status": 1,
|
|
"remark": "这是总公司",
|
|
"create_at": "2023-01-01 10:00:00"
|
|
},
|
|
{
|
|
"id": 4,
|
|
"parent_id": 1,
|
|
"dept_name": "济南分公司",
|
|
"sort": 2,
|
|
"leader": "就眠仪式",
|
|
"phone": "12312345679",
|
|
"email": "123qq.com",
|
|
"status": 1,
|
|
"remark": "这是济南",
|
|
"create_at": "2023-01-01 10:00:00"
|
|
},
|
|
{
|
|
"id": 5,
|
|
"parent_id": 1,
|
|
"dept_name": "唐山分公司",
|
|
"sort": 4,
|
|
"leader": "mkg",
|
|
"phone": "12312345679",
|
|
"email": "123qq.com",
|
|
"status": 1,
|
|
"remark": "这是唐山",
|
|
"create_at": "2023-01-01 10:00:00"
|
|
},
|
|
{
|
|
"id": 7,
|
|
"parent_id": 4,
|
|
"dept_name": "济南分公司开发部",
|
|
"sort": 5,
|
|
"leader": "就眠仪式",
|
|
"phone": "12312345679",
|
|
"email": "123qq.com",
|
|
"status": 1,
|
|
"remark": "测试",
|
|
"create_at": "2023-01-01 10:00:00"
|
|
},
|
|
{
|
|
"id": 8,
|
|
"parent_id": 5,
|
|
"dept_name": "唐山测试部",
|
|
"sort": 5,
|
|
"leader": "mkg",
|
|
"phone": "12312345679",
|
|
"email": "123qq.com",
|
|
"status": 1,
|
|
"remark": "测试部",
|
|
"create_at": "2023-01-01 10:00:00"
|
|
}
|
|
],
|
|
"powers": [
|
|
{
|
|
"id": 1,
|
|
"name": "系统管理",
|
|
"type": "0",
|
|
"code": "",
|
|
"url": null,
|
|
"open_type": null,
|
|
"parent_id": "0",
|
|
"icon": "layui-icon layui-icon-set-fill",
|
|
"sort": 1,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 3,
|
|
"name": "用户管理",
|
|
"type": "1",
|
|
"code": "system:user:main",
|
|
"url": "/system/user/",
|
|
"open_type": "_iframe",
|
|
"parent_id": "1",
|
|
"icon": "layui-icon layui-icon layui-icon layui-icon layui-icon-rate",
|
|
"sort": 1,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 4,
|
|
"name": "权限管理",
|
|
"type": "1",
|
|
"code": "system:power:main",
|
|
"url": "/system/power/",
|
|
"open_type": "_iframe",
|
|
"parent_id": "1",
|
|
"icon": null,
|
|
"sort": 2,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 9,
|
|
"name": "角色管理",
|
|
"type": "1",
|
|
"code": "system:role:main",
|
|
"url": "/system/role/",
|
|
"open_type": "_iframe",
|
|
"parent_id": "1",
|
|
"icon": "layui-icon layui-icon-username",
|
|
"sort": 2,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 12,
|
|
"name": "系统监控",
|
|
"type": "1",
|
|
"code": "system:monitor:main",
|
|
"url": "/system/monitor/",
|
|
"open_type": "_iframe",
|
|
"parent_id": "1",
|
|
"icon": "layui-icon layui-icon-vercode",
|
|
"sort": 5,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 13,
|
|
"name": "日志管理",
|
|
"type": "1",
|
|
"code": "system:log:main",
|
|
"url": "/system/log/",
|
|
"open_type": "_iframe",
|
|
"parent_id": "1",
|
|
"icon": "layui-icon layui-icon-read",
|
|
"sort": 4,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 17,
|
|
"name": "文件管理",
|
|
"type": "0",
|
|
"code": "",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "0",
|
|
"icon": "layui-icon layui-icon-camera",
|
|
"sort": 2,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 18,
|
|
"name": "图片上传",
|
|
"type": "1",
|
|
"code": "system:file:main",
|
|
"url": "/system/file/",
|
|
"open_type": "_iframe",
|
|
"parent_id": "17",
|
|
"icon": "layui-icon layui-icon-camera",
|
|
"sort": 5,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 21,
|
|
"name": "权限增加",
|
|
"type": "2",
|
|
"code": "system:power:add",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "4",
|
|
"icon": "layui-icon layui-icon-add-circle",
|
|
"sort": 1,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 22,
|
|
"name": "用户增加",
|
|
"type": "2",
|
|
"code": "system:user:add",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "3",
|
|
"icon": "layui-icon layui-icon-add-circle",
|
|
"sort": 1,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 23,
|
|
"name": "用户编辑",
|
|
"type": "2",
|
|
"code": "system:user:edit",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "3",
|
|
"icon": "layui-icon layui-icon-rate",
|
|
"sort": 2,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 24,
|
|
"name": "用户删除",
|
|
"type": "2",
|
|
"code": "system:user:remove",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "3",
|
|
"icon": "",
|
|
"sort": 3,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 25,
|
|
"name": "权限编辑",
|
|
"type": "2",
|
|
"code": "system:power:edit",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "4",
|
|
"icon": "",
|
|
"sort": 2,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 26,
|
|
"name": "权限删除",
|
|
"type": "2",
|
|
"code": "system:power:remove",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "4",
|
|
"icon": "",
|
|
"sort": 3,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 27,
|
|
"name": "用户增加",
|
|
"type": "2",
|
|
"code": "system:role:add",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "9",
|
|
"icon": "",
|
|
"sort": 1,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 28,
|
|
"name": "角色编辑",
|
|
"type": "2",
|
|
"code": "system:role:edit",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "9",
|
|
"icon": "",
|
|
"sort": 2,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 29,
|
|
"name": "角色删除",
|
|
"type": "2",
|
|
"code": "system:role:remove",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "9",
|
|
"icon": "",
|
|
"sort": 3,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 30,
|
|
"name": "角色授权",
|
|
"type": "2",
|
|
"code": "system:role:power",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "9",
|
|
"icon": "",
|
|
"sort": 4,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 31,
|
|
"name": "图片增加",
|
|
"type": "2",
|
|
"code": "system:file:add",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "18",
|
|
"icon": "",
|
|
"sort": 1,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 32,
|
|
"name": "图片删除",
|
|
"type": "2",
|
|
"code": "system:file:delete",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "18",
|
|
"icon": "",
|
|
"sort": 2,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 44,
|
|
"name": "数据字典",
|
|
"type": "1",
|
|
"code": "system:dict:main",
|
|
"url": "/system/dict/",
|
|
"open_type": "_iframe",
|
|
"parent_id": "1",
|
|
"icon": "layui-icon layui-icon-console",
|
|
"sort": 6,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 45,
|
|
"name": "字典增加",
|
|
"type": "2",
|
|
"code": "system:dict:add",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "44",
|
|
"icon": "",
|
|
"sort": 1,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 46,
|
|
"name": "字典修改",
|
|
"type": "2",
|
|
"code": "system:dict:edit",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "44",
|
|
"icon": "",
|
|
"sort": 2,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 47,
|
|
"name": "字典删除",
|
|
"type": "2",
|
|
"code": "system:dict:remove",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "44",
|
|
"icon": "",
|
|
"sort": 3,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 48,
|
|
"name": "部门管理",
|
|
"type": "1",
|
|
"code": "system:dept:main",
|
|
"url": "/system/dept/",
|
|
"open_type": "_iframe",
|
|
"parent_id": "1",
|
|
"icon": "layui-icon layui-icon-group",
|
|
"sort": 3,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 49,
|
|
"name": "部门增加",
|
|
"type": "2",
|
|
"code": "system:dept:add",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "48",
|
|
"icon": "",
|
|
"sort": 1,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 50,
|
|
"name": "部门编辑",
|
|
"type": "2",
|
|
"code": "system:dept:edit",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "48",
|
|
"icon": "",
|
|
"sort": 2,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 51,
|
|
"name": "部门删除",
|
|
"type": "2",
|
|
"code": "system:dept:remove",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "48",
|
|
"icon": "",
|
|
"sort": 3,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 57,
|
|
"name": "邮件管理",
|
|
"type": "1",
|
|
"code": "system:mail:main",
|
|
"url": "/system/mail/",
|
|
"open_type": "_iframe",
|
|
"parent_id": "1",
|
|
"icon": "layui-icon ",
|
|
"sort": 7,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 58,
|
|
"name": "邮件发送",
|
|
"type": "2",
|
|
"code": "system:mail:add",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "57",
|
|
"icon": "layui-icon layui-icon-ok-circle",
|
|
"sort": 1,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 59,
|
|
"name": "邮件删除",
|
|
"type": "2",
|
|
"code": "system:mail:remove",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "57",
|
|
"icon": "",
|
|
"sort": 2,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 60,
|
|
"name": "导航管理",
|
|
"type": "1",
|
|
"code": "system:nav:main",
|
|
"url": "/system/nav/",
|
|
"open_type": "_iframe",
|
|
"parent_id": "1",
|
|
"icon": "layui-icon layui-icon-link",
|
|
"sort": 9,
|
|
"create_time": "2026-09-05 14:30:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 61,
|
|
"name": "导航新增",
|
|
"type": "2",
|
|
"code": "system:nav:add",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "60",
|
|
"icon": "",
|
|
"sort": 1,
|
|
"create_time": "2026-09-05 14:30:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 62,
|
|
"name": "导航编辑",
|
|
"type": "2",
|
|
"code": "system:nav:edit",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "60",
|
|
"icon": "",
|
|
"sort": 2,
|
|
"create_time": "2026-09-05 14:30:00",
|
|
"enable": 1
|
|
},
|
|
{
|
|
"id": 63,
|
|
"name": "导航删除",
|
|
"type": "2",
|
|
"code": "system:nav:remove",
|
|
"url": "",
|
|
"open_type": "",
|
|
"parent_id": "60",
|
|
"icon": "",
|
|
"sort": 3,
|
|
"create_time": "2026-09-05 14:30:00",
|
|
"enable": 1
|
|
}
|
|
],
|
|
"roles": [
|
|
{
|
|
"id": 1,
|
|
"code": "admin",
|
|
"name": "管理员",
|
|
"enable": 1,
|
|
"details": "管理员",
|
|
"sort": 1,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"power_ids": []
|
|
},
|
|
{
|
|
"id": 2,
|
|
"code": "common",
|
|
"name": "普通用户",
|
|
"enable": 1,
|
|
"details": "只有查看,没有增删改权限",
|
|
"sort": 2,
|
|
"create_time": "2023-01-01 10:00:00",
|
|
"power_ids": [
|
|
1,
|
|
3,
|
|
4,
|
|
9,
|
|
12,
|
|
13,
|
|
17,
|
|
18,
|
|
44,
|
|
48
|
|
]
|
|
}
|
|
],
|
|
"users": [
|
|
{
|
|
"id": 1,
|
|
"username": "admin",
|
|
"password_hash": "pbkdf2:sha256:150000$raM7mDSr$58fe069c3eac01531fc8af85e6fc200655dd2588090530084d182e6ec9d52c85",
|
|
"create_at": "2023-01-01 10:00:00",
|
|
"enable": 1,
|
|
"realname": "超级管理",
|
|
"remark": "要是不能把握时机,就要终身蹭蹬,一事无成!",
|
|
"avatar": "/static/system/admin/images/avatar.jpg",
|
|
"dept_id": 1,
|
|
"role_ids": [
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"id": 2,
|
|
"username": "test",
|
|
"password_hash": "pbkdf2:sha256:150000$cRS8bYNh$adb57e64d929863cf159f924f74d0634f1fecc46dba749f1bfaca03da6d2e3ac",
|
|
"create_at": "2023-01-01 10:00:00",
|
|
"enable": 1,
|
|
"realname": "测试",
|
|
"remark": "要是不能把握时机,就要终身蹭蹬,一事无成!",
|
|
"avatar": "/static/system/admin/images/avatar.jpg",
|
|
"dept_id": 1,
|
|
"role_ids": [
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"id": "3",
|
|
"username": "wind",
|
|
"password_hash": "pbkdf2:sha256:150000$skME1obT$6a2c20cd29f89d7d2f21d9e373a7e3445f70ebce3ef1c3a555e42a7d17170b37",
|
|
"create_at": "2023-01-01 10:00:00",
|
|
"enable": 1,
|
|
"realname": "风",
|
|
"remark": "要是不能把握时机,就要终身蹭蹬,一事无成!",
|
|
"avatar": "/static/system/admin/images/avatar.jpg",
|
|
"dept_id": 7,
|
|
"role_ids": []
|
|
}
|
|
],
|
|
"navs": [
|
|
{
|
|
"category": "开发工具",
|
|
"title": "GitHub",
|
|
"url": "https://github.com",
|
|
"description": "全球最大开源代码托管平台",
|
|
"icon": "layui-icon layui-icon-website",
|
|
"sort": 1,
|
|
"status": 1,
|
|
"is_external": 1,
|
|
"create_by": "admin",
|
|
"create_at": "2026-09-05 14:30:00"
|
|
},
|
|
{
|
|
"category": "开发工具",
|
|
"title": "Stack Overflow",
|
|
"url": "https://stackoverflow.com",
|
|
"description": "全球程序员问答社区",
|
|
"icon": "layui-icon layui-icon-help",
|
|
"sort": 2,
|
|
"status": 1,
|
|
"is_external": 1,
|
|
"create_by": "admin",
|
|
"create_at": "2026-09-05 14:30:00"
|
|
},
|
|
{
|
|
"category": "开发工具",
|
|
"title": "MDN Web Docs",
|
|
"url": "https://developer.mozilla.org",
|
|
"description": "Web 开发权威文档",
|
|
"icon": "layui-icon layui-icon-read",
|
|
"sort": 3,
|
|
"status": 1,
|
|
"is_external": 1,
|
|
"create_by": "admin",
|
|
"create_at": "2026-09-05 14:30:00"
|
|
},
|
|
{
|
|
"category": "开发工具",
|
|
"title": "Gitee",
|
|
"url": "https://gitee.com",
|
|
"description": "国内代码托管平台",
|
|
"icon": "layui-icon layui-icon-website",
|
|
"sort": 4,
|
|
"status": 1,
|
|
"is_external": 1,
|
|
"create_by": "admin",
|
|
"create_at": "2026-09-05 14:30:00"
|
|
},
|
|
{
|
|
"category": "AI 工具",
|
|
"title": "ChatGPT",
|
|
"url": "https://chat.openai.com",
|
|
"description": "OpenAI 出品的对话式 AI",
|
|
"icon": "layui-icon layui-icon-console",
|
|
"sort": 1,
|
|
"status": 1,
|
|
"is_external": 1,
|
|
"create_by": "admin",
|
|
"create_at": "2026-09-05 14:30:00"
|
|
},
|
|
{
|
|
"category": "AI 工具",
|
|
"title": "Claude",
|
|
"url": "https://claude.ai",
|
|
"description": "Anthropic 出品的 AI 助手",
|
|
"icon": "layui-icon layui-icon-console",
|
|
"sort": 2,
|
|
"status": 1,
|
|
"is_external": 1,
|
|
"create_by": "admin",
|
|
"create_at": "2026-09-05 14:30:00"
|
|
},
|
|
{
|
|
"category": "AI 工具",
|
|
"title": "通义千问",
|
|
"url": "https://tongyi.aliyun.com",
|
|
"description": "阿里云出品的国产大模型",
|
|
"icon": "layui-icon layui-icon-console",
|
|
"sort": 3,
|
|
"status": 1,
|
|
"is_external": 1,
|
|
"create_by": "admin",
|
|
"create_at": "2026-09-05 14:30:00"
|
|
},
|
|
{
|
|
"category": "设计资源",
|
|
"title": "Dribbble",
|
|
"url": "https://dribbble.com",
|
|
"description": "全球设计灵感社区",
|
|
"icon": "layui-icon layui-icon-picture",
|
|
"sort": 1,
|
|
"status": 1,
|
|
"is_external": 1,
|
|
"create_by": "admin",
|
|
"create_at": "2026-09-05 14:30:00"
|
|
},
|
|
{
|
|
"category": "设计资源",
|
|
"title": "Behance",
|
|
"url": "https://www.behance.net",
|
|
"description": "Adobe 旗下的设计师作品集平台",
|
|
"icon": "layui-icon layui-icon-picture",
|
|
"sort": 2,
|
|
"status": 1,
|
|
"is_external": 1,
|
|
"create_by": "admin",
|
|
"create_at": "2026-09-05 14:30:00"
|
|
},
|
|
{
|
|
"category": "设计资源",
|
|
"title": "优设",
|
|
"url": "https://www.uisdc.com",
|
|
"description": "国内优秀设计师导航",
|
|
"icon": "layui-icon layui-icon-picture",
|
|
"sort": 3,
|
|
"status": 1,
|
|
"is_external": 1,
|
|
"create_by": "admin",
|
|
"create_at": "2026-09-05 14:30:00"
|
|
}
|
|
]
|
|
} |