Vue + Element 搭建后台管理系统(九)

接口请求格式定义

前台显示需要后台数据,我们这里先把前后端交互接口定义好,没有后台的时候,也方便用mock模拟。

接口定义遵循几个规范:

1. 接口按功能模块划分。

系统登录:登录相关接口

用户管理:用户管理相关接口

机构管理:机构管理相关接口

角色管理 : 角色管理相关接口

菜单管理 : 菜单管理相关接口

字典管理 : 字典管理相关接口

日志管理 : 日志管理相关接口

2. 通用增删改查接口采用统一命名规范。

save : 保存操作

update: 更新操作

delete: 删除操作

findAll: 查询全部

findPage : 分页查询

findTree : 返回对象树

findByXX:根据XX查询

2. 统一请求响应结果。

格式如下:

{
  "code": 200, // 状态吗,200:请求成功,其他:请求出错
  "msg": null, // 错误消息,成功返回 null, 否则返回出错信息
  "data": {   // 返回请求数据,JSON 数据格式
    ...
  }
}

系统登录

登录接口

请求URL: /sys/login

请求类型: post

请求参数:

{
  "captcha": "3323",
  "password": "admin",
  "username": "admin"
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": {
    "id": null,
    "userId": 1,
    "token": "77ae89be36504adfb5c09ef71409ea0e",
    "expireTime": "2018-09-01T16:24:50.473+0000",
    "createBy": null,
    "createTime": null,
    "lastUpdateBy": null,
    "lastUpdateTime": "2018-09-01T04:24:50.473+0000"
  }
}

用户管理

保存

请求URL: /user/save

请求类型: post

请求参数:

{
  "createBy": 0,
  "createTime": "2018-09-01T05:40:23.342Z",
  "delFlag": 0,
  "deptId": 110,
  "deptName": "",
  "email": "[email protected]",
  "lastUpdateBy": 0,
  "lastUpdateTime": "2018-09-01T05:40:23.342Z",
  "mobile": "18999878998",
  "password": "123456",
  "salt": "1312321321",
  "status": 0,
  "userId": 110,
  "username": "test"
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

修改

请求URL: /user/update

请求类型: post

请求参数:

{
  "mobile": "[email protected]",
  "userId": 110,
  "username": "test"
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

删除

请求URL: /user/delete

请求类型: post

请求参数:

{
  "userId": 110
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

分页查询

请求URL: /user/findPage

请求类型: post

请求参数:

{
  "pageNum": 1,
  "pageSize": 5
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": {
    "pageNum": 1,
    "pageSize": 5,
    "totalSize": 5,
    "totalPages": 1,
    "content": [
      {
        "userId": 1,
        "username": "admin",
        "password": "9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d",
        "salt": "YzcmCZNvbXocrsz9dm8e",
        "email": "[email protected]",
        "mobile": "13612345678",
        "status": 1,
        "deptId": null,
        "deptName": null,
        "createBy": null,
        "createTime": "2018-08-14T03:11:11.000+0000",
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "delFlag": 0
      },
      {
        "userId": 2,
        "username": "Louis",
        "password": "9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d",
        "salt": "YzcmCZNvbXocrsz9dm8e",
        "email": "[email protected]",
        "mobile": "18200932238",
        "status": 1,
        "deptId": null,
        "deptName": null,
        "createBy": null,
        "createTime": "2018-08-14T03:11:11.000+0000",
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "delFlag": 0
      },
      {
        "userId": 3,
        "username": "Kobe",
        "password": "9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d",
        "salt": "YzcmCZNvbXocrsz9dm8e",
        "email": "[email protected]",
        "mobile": "18200932238",
        "status": 1,
        "deptId": null,
        "deptName": null,
        "createBy": null,
        "createTime": "2018-08-14T03:11:11.000+0000",
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "delFlag": 0
      },
      {
        "userId": 4,
        "username": "Iverson",
        "password": "9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d",
        "salt": "YzcmCZNvbXocrsz9dm8e",
        "email": "[email protected]",
        "mobile": "18200932238",
        "status": 1,
        "deptId": null,
        "deptName": null,
        "createBy": null,
        "createTime": "2018-08-14T03:11:11.000+0000",
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "delFlag": 0
      },
      {
        "userId": 110,
        "username": "test",
        "password": "123456",
        "salt": "1312321321",
        "email": "[email protected]",
        "mobile": "[email protected]",
        "status": 0,
        "deptId": 110,
        "deptName": null,
        "createBy": 0,
        "createTime": "2018-09-01T05:40:23.000+0000",
        "lastUpdateBy": 0,
        "lastUpdateTime": "2018-09-01T05:40:23.000+0000",
        "delFlag": 0
      }
    ]
  }
}

根据用户查询

请求URL: /user/findByUserName

请求类型: get

请求参数:

{
  "userName": "admin"
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": {
    "userId": 1,
    "username": "admin",
    "password": "9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d",
    "salt": "YzcmCZNvbXocrsz9dm8e",
    "email": "[email protected]",
    "mobile": "13612345678",
    "status": 1,
    "deptId": null,
    "deptName": null,
    "createBy": null,
    "createTime": "2018-08-14T03:11:11.000+0000",
    "lastUpdateBy": null,
    "lastUpdateTime": null,
    "delFlag": 0
  }
}

更新密码

请求URL: /user/updatePassword

请求类型: get

请求参数:

{
  "password ": "password ",
  "newPassword ": "newPassword "
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

机构管理

保存

请求URL: /dept/save

请求类型: post

请求参数:

{
  "children": [
    null
  ],
  "createBy": 0,
  "createTime": "2018-09-01T05:34:44.618Z",
  "delFlag": 0,
  "deptId": 110,
  "lastUpdateBy": 0,
  "lastUpdateTime": "2018-09-01T05:34:44.618Z",
  "name": "110",
  "orderNum": 0,
  "parentId": 0
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

修改

请求URL: /dept/update

请求类型: post

请求参数:

{
  "deptId": 110,
  "name": "upate"
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

删除

请求URL: /dept/delete

请求类型: post

请求参数:

{
  "deptId": 110
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

查询机构树

请求URL: /dept/findTree

请求类型: get

请求参数:

{}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": [
    {
      "deptId": 1,
      "parentId": 0,
      "name": "轻尘集团",
      "orderNum": 0,
      "createBy": null,
      "createTime": null,
      "lastUpdateBy": null,
      "lastUpdateTime": null,
      "delFlag": 0,
      "children": [
        {
          "deptId": 2,
          "parentId": 1,
          "name": "北京分公司",
          "orderNum": 1,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": []
        },
        {
          "deptId": 3,
          "parentId": 1,
          "name": "上海分公司",
          "orderNum": 2,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": [
            {
              "deptId": 4,
              "parentId": 3,
              "name": "技术部",
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "deptId": 6,
              "parentId": 3,
              "name": "宣传部",
              "orderNum": 1,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "deptId": 7,
              "parentId": 3,
              "name": "销售部",
              "orderNum": 2,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "deptId": 8,
              "parentId": 3,
              "name": "市场部",
              "orderNum": 3,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            }
          ]
        }
      ]
    },
    {
      "deptId": 9,
      "parentId": 0,
      "name": "牧尘集团",
      "orderNum": 1,
      "createBy": null,
      "createTime": null,
      "lastUpdateBy": null,
      "lastUpdateTime": null,
      "delFlag": 0,
      "children": [
        {
          "deptId": 10,
          "parentId": 9,
          "name": "北京分公司",
          "orderNum": 1,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": [
            {
              "deptId": 12,
              "parentId": 10,
              "name": "技术部",
              "orderNum": 1,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "deptId": 13,
              "parentId": 10,
              "name": "宣传部",
              "orderNum": 2,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            }
          ]
        },
        {
          "deptId": 11,
          "parentId": 9,
          "name": "上海分公司",
          "orderNum": 2,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": [
            {
              "deptId": 14,
              "parentId": 11,
              "name": "销售部",
              "orderNum": 1,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "deptId": 15,
              "parentId": 11,
              "name": "市场部",
              "orderNum": 2,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            }
          ]
        }
      ]
    }
  ]
}

角色管理

保存

请求URL: /role/save

请求类型: post

请求参数:

{
  "createBy": 0,
  "createTime": "2018-09-01T05:54:31.748Z",
  "delFlag": 0,
  "lastUpdateBy": 0,
  "lastUpdateTime": "2018-09-01T05:54:31.748Z",
  "remark": "string",
  "roleId": 110,
  "roleName": "110"
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

修改

请求URL: /role/update

请求类型: post

请求参数:

{
  "remark": "1101111",
  "roleId": 110,
  "roleName": "1101"
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

删除

请求URL: /role/delete

请求类型: post

请求参数:

{
  "roleId": 110
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

分页查询

请求URL: /role/findPage

请求类型: post

请求参数:

{
  "pageNum": 1,
  "pageSize": 5
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": {
    "pageNum": 1,
    "pageSize": 5,
    "totalSize": 4,
    "totalPages": 1,
    "content": [
      {
        "roleId": 1,
        "roleName": "admin",
        "remark": "超级管理员",
        "createBy": null,
        "createTime": "2018-08-14T03:11:11.000+0000",
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "delFlag": 0
      },
      {
        "roleId": 2,
        "roleName": "dev",
        "remark": "开发人员",
        "createBy": null,
        "createTime": "2018-08-14T03:11:11.000+0000",
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "delFlag": 0
      },
      {
        "roleId": 3,
        "roleName": "test",
        "remark": "测试人员",
        "createBy": null,
        "createTime": "2018-08-14T03:11:11.000+0000",
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "delFlag": 0
      },
      {
        "roleId": 110,
        "roleName": "1101",
        "remark": "1101111",
        "createBy": 0,
        "createTime": "2018-09-01T05:54:32.000+0000",
        "lastUpdateBy": 0,
        "lastUpdateTime": "2018-09-01T05:54:32.000+0000",
        "delFlag": 0
      }
    ]
  }
}

查询全部

请求URL: /role/findAll

请求类型: get

请求参数:

{

}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": [
    {
      "roleId": 1,
      "roleName": "admin",
      "remark": "超级管理员",
      "createBy": null,
      "createTime": "2018-08-14T03:11:11.000+0000",
      "lastUpdateBy": null,
      "lastUpdateTime": null,
      "delFlag": 0
    },
    {
      "roleId": 2,
      "roleName": "dev",
      "remark": "开发人员",
      "createBy": null,
      "createTime": "2018-08-14T03:11:11.000+0000",
      "lastUpdateBy": null,
      "lastUpdateTime": null,
      "delFlag": 0
    },
    {
      "roleId": 3,
      "roleName": "test",
      "remark": "测试人员",
      "createBy": null,
      "createTime": "2018-08-14T03:11:11.000+0000",
      "lastUpdateBy": null,
      "lastUpdateTime": null,
      "delFlag": 0
    },
    {
      "roleId": 110,
      "roleName": "1101",
      "remark": "1101111",
      "createBy": 0,
      "createTime": "2018-09-01T05:54:32.000+0000",
      "lastUpdateBy": 0,
      "lastUpdateTime": "2018-09-01T05:54:32.000+0000",
      "delFlag": 0
    }
  ]
}

菜单管理

保存

请求URL: /menu/save

请求类型: post

请求参数:

{
  "createBy": 0,
  "createTime": "2018-09-01T06:01:47.825Z",
  "delFlag": 0,
  "icon": "string",
  "lastUpdateBy": 0,
  "lastUpdateTime": "2018-09-01T06:01:47.825Z",
  "menuId": 110,
  "name": "110",
  "orderNum": 0,
  "parentId": 0,
  "perms": "sys:menu:list",
  "type": 0,
  "url": "/sys/menu"
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

修改

请求URL: /menu/update

请求类型: post

请求参数:

{
  "menuId": 110,
  "name": "1101"
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

删除

请求URL: /menu/delete

请求类型: post

请求参数:

{
  "menuId": 110
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

查询菜单树

请求URL: /menu/findTree

请求类型: get

请求参数:

{}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": [
    {
      "menuId": 1,
      "parentId": 0,
      "name": "系统管理",
      "url": null,
      "perms": null,
      "type": 0,
      "icon": "fa el-icon-setting",
      "orderNum": 0,
      "createBy": null,
      "createTime": null,
      "lastUpdateBy": null,
      "lastUpdateTime": null,
      "delFlag": 0,
      "children": [
        {
          "menuId": 2,
          "parentId": 1,
          "name": "用户管理",
          "url": "/sys/user",
          "perms": null,
          "type": 1,
          "icon": "el-icon-service",
          "orderNum": 1,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": [
            {
              "menuId": 9,
              "parentId": 2,
              "name": "查看",
              "url": null,
              "perms": "sys:user:view",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 10,
              "parentId": 2,
              "name": "新增",
              "url": null,
              "perms": "sys:user:save",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 11,
              "parentId": 2,
              "name": "修改",
              "url": null,
              "perms": "sys:user:update",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 12,
              "parentId": 2,
              "name": "删除",
              "url": null,
              "perms": "sys:user:delete",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            }
          ]
        },
        {
          "menuId": 3,
          "parentId": 1,
          "name": "机构管理",
          "url": "/sys/dept",
          "perms": null,
          "type": 1,
          "icon": "el-icon-news",
          "orderNum": 2,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": [
            {
              "menuId": 13,
              "parentId": 3,
              "name": "查看",
              "url": null,
              "perms": "sys:dept:view",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 14,
              "parentId": 3,
              "name": "新增",
              "url": null,
              "perms": "sys:dept:save",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 15,
              "parentId": 3,
              "name": "修改",
              "url": null,
              "perms": "sys:dept:update",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 16,
              "parentId": 3,
              "name": "删除",
              "url": null,
              "perms": "sys:dept:delete",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            }
          ]
        },
        {
          "menuId": 4,
          "parentId": 1,
          "name": "角色管理",
          "url": "/sys/role",
          "perms": null,
          "type": 1,
          "icon": "el-icon-view",
          "orderNum": 4,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": [
            {
              "menuId": 17,
              "parentId": 4,
              "name": "查看",
              "url": null,
              "perms": "sys:role:view",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 18,
              "parentId": 4,
              "name": "新增",
              "url": null,
              "perms": "sys:role:save",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 19,
              "parentId": 4,
              "name": "修改",
              "url": null,
              "perms": "sys:role:update",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 20,
              "parentId": 4,
              "name": "删除",
              "url": null,
              "perms": "sys:role:delete",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            }
          ]
        },
        {
          "menuId": 5,
          "parentId": 1,
          "name": "菜单管理",
          "url": "/sys/menu",
          "perms": null,
          "type": 1,
          "icon": "el-icon-menu",
          "orderNum": 5,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": [
            {
              "menuId": 21,
              "parentId": 5,
              "name": "查看",
              "url": null,
              "perms": "sys:menu:view",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 22,
              "parentId": 5,
              "name": "新增",
              "url": null,
              "perms": "sys:menu:save",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 23,
              "parentId": 5,
              "name": "修改",
              "url": null,
              "perms": "sys:menu:update",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            },
            {
              "menuId": 24,
              "parentId": 5,
              "name": "删除",
              "url": null,
              "perms": "sys:menu:delete",
              "type": 2,
              "icon": null,
              "orderNum": 0,
              "createBy": null,
              "createTime": null,
              "lastUpdateBy": null,
              "lastUpdateTime": null,
              "delFlag": 0,
              "children": []
            }
          ]
        },
        {
          "menuId": 6,
          "parentId": 1,
          "name": "SQL监控",
          "url": "/druid/sql",
          "perms": null,
          "type": 1,
          "icon": "el-icon-info",
          "orderNum": 6,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": []
        },
        {
          "menuId": 8,
          "parentId": 1,
          "name": "系统日志",
          "url": "/sys/log",
          "perms": "sys:log:list",
          "type": 1,
          "icon": "el-icon-info",
          "orderNum": 7,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": []
        }
      ]
    },
    {
      "menuId": 25,
      "parentId": 0,
      "name": "内容管理",
      "url": null,
      "perms": null,
      "type": 0,
      "icon": "el-icon-document",
      "orderNum": 0,
      "createBy": null,
      "createTime": null,
      "lastUpdateBy": null,
      "lastUpdateTime": null,
      "delFlag": 0,
      "children": [
        {
          "menuId": 26,
          "parentId": 25,
          "name": "栏目管理",
          "url": "/content/category",
          "perms": null,
          "type": 1,
          "icon": "el-icon-tickets",
          "orderNum": 1,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": []
        },
        {
          "menuId": 27,
          "parentId": 25,
          "name": "文章管理",
          "url": "/content/artical",
          "perms": null,
          "type": 1,
          "icon": "el-icon-tickets",
          "orderNum": 2,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": []
        }
      ]
    },
    {
      "menuId": 28,
      "parentId": 0,
      "name": "使用案例",
      "url": null,
      "perms": null,
      "type": 0,
      "icon": "el-icon-picture-outline",
      "orderNum": 0,
      "createBy": null,
      "createTime": null,
      "lastUpdateBy": null,
      "lastUpdateTime": null,
      "delFlag": 0,
      "children": [
        {
          "menuId": 29,
          "parentId": 28,
          "name": "国际化",
          "url": "/demo/i18n",
          "perms": null,
          "type": 1,
          "icon": "el-icon-edit",
          "orderNum": 1,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": []
        },
        {
          "menuId": 30,
          "parentId": 28,
          "name": "换皮肤",
          "url": "/demo/theme",
          "perms": null,
          "type": 1,
          "icon": "el-icon-picture",
          "orderNum": 2,
          "createBy": null,
          "createTime": null,
          "lastUpdateBy": null,
          "lastUpdateTime": null,
          "delFlag": 0,
          "children": []
        }
      ]
    }
  ]
}

字典管理

保存

请求URL: /dict/save

请求类型: post

请求参数:

{
  "createBy": 0,
  "createTime": "2018-09-01T06:05:44.794Z",
  "delFlag": 0,
  "description": "aaaa",
  "id": 110,
  "label": "aa",
  "lastUpdateBy": 0,
  "lastUpdateTime": "2018-09-01T06:05:44.794Z",
  "remarks": "aaaaaa",
  "sort": 0,
  "type": "a",
  "value": "aaaaa"
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

修改

请求URL: /dict/update

请求类型: post

请求参数:

{
  "description": "bbbb",
  "id": 110,
  "label": "bbbb"
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

删除

请求URL: /dict/delete

请求类型: post

请求参数:

{
  "id": 110
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": 1
}

分页查询

请求URL: /dict/findPage

请求类型: get

请求参数:

{
  "pageNum": 1,
  "pageSize": 5
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": {
    "pageNum": 1,
    "pageSize": 5,
    "totalSize": 2,
    "totalPages": 1,
    "content": [
      {
        "id": 1,
        "value": "male",
        "label": "男",
        "type": "sex",
        "description": "男性",
        "sort": 0,
        "createBy": null,
        "createTime": null,
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "remarks": null,
        "delFlag": 0
      },
      {
        "id": 2,
        "value": "female",
        "label": "女",
        "type": "sex",
        "description": "女性",
        "sort": 1,
        "createBy": null,
        "createTime": null,
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "remarks": null,
        "delFlag": 0
      }
    ]
  }
}

日志管理

分页查询

请求URL: /log/findPage

请求类型: get

请求参数:

{
  "pageNum": 1,
  "pageSize": 5
}

请求结果:

{
  "code": 200,
  "msg": null,
  "data": {
    "pageNum": 1,
    "pageSize": 5,
    "totalSize": 2,
    "totalPages": 1,
    "content": [
      {
        "id": 1,
        "value": "male",
        "label": "男",
        "type": "sex",
        "description": "男性",
        "sort": 0,
        "createBy": null,
        "createTime": null,
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "remarks": null,
        "delFlag": 0
      },
      {
        "id": 2,
        "value": "female",
        "label": "女",
        "type": "sex",
        "description": "女性",
        "sort": 1,
        "createBy": null,
        "createTime": null,
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "remarks": null,
        "delFlag": 0
      }
    ]
  }
}

源码下载

码云:https://gitee.com/liuge1988/kitty-ui.git



作者:朝雨忆轻尘
出处:https://www.cnblogs.com/xifengxiaoma/
版权所有,欢迎转载,转载请注明原文作者及出处。

原文地址:https://www.cnblogs.com/xifengxiaoma/p/9570268.html

时间: 2024-10-24 21:59:46

Vue + Element 搭建后台管理系统(九)的相关文章

Vue + Element 搭建后台管理系统(一)

技术基础 开发之前,请先熟悉下面的4个文档 vue.js2.0中文, 项目所使用的js框架 vue-router, vue.js配套路由 vuex,状态管理 Element,UI框架 开发环境 Node JS(npm) Visual Studio Code(前端IDE) 安装Visual Studio Code 下载地址: 官网下载地址 Visual Studio Code 是一款非常优秀的开源编辑器,非常适合作为前端IDE, 根据自己的系统下载相应的版本进行安装. 更多 VS Code 教程可

vue2.0 + element ui 后台管理系统

vue2.0 和 elementui  搭建的一个后台管理系统 概述: 这是一个用vuejs2.0和element搭建的后台管理界面. 技术栈: vue2.0:渐进式JavaScript框架,易用.灵活.高效,似乎任何规模的应用都适用. element ui:基于vue2.0的ui组件库. vue-router:一般单页面应用spa都要用到的前端路由. vuex:Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式. webpack + es6/7 + less mock.js : 相

VUE+ElementUI 搭建后台项目(一)

前言 之前有些过移动端的项目搭建的文章,感觉不写个pc端管理系统老感觉少了点什么,最近公司项目比较多,恰巧要做一个申报系统的后台管理系统,鉴于对vue技术栈比较熟悉,所以考虑还是使用vue技术栈来做:看过一个不错的后台配置模板(vue-element-admin),页面也挺美的,但是还是碍于不想看太多关于这个模板的配置说明,于是又拉出来之前我搭建的简易版的模板,决定重构下,使用自己搭建的后台系统模板,配置非常简单:本文将从初始化项目开始一直到打包上线做一个详细的介绍,看完本文章,绝对会对其中的一

淘淘商城_0200_搭建后台管理系统

后台管理系统工程搭建 项目是maven项目,Maven的工程类型: 1.war包工程:web工程 2.Jar包工程:java工程,打完是一个jar包 3.Pom工程:父工程,聚合工程 ,这两个一般合起来用,pom工程即做父工程,又做聚合工程来聚合其他模块,以方便执行maven命令. 1.1   父工程的搭建 打开myeclipse 右键new ,new一个maven project,勾选create a simple project 修改pom文件: <project xmlns="htt

Vue电商后台管理系统项目第3篇-首页用户列表增删改查功能

前言 由于之前的作者没有再更新这个后台管理系统项目的文章了,我想着把它的项目重头到位做一遍,把剩下的文章写完,把这个项目记录完整,以后遇到类似的后台管理系统项目,可以快速复习一些知识点. 新的项目地址:https://github.com/C4az6/vue_manage_system 添加用户 这个操作在用户列表页面,所以路由不用再进行 处理了. 基于单文件组件: 添加事件绑定--弹出新增用户对话框 添加dialog对话框 Element-UI组件>dialog对话框>自定义内容>表单

Django打造在线教育平台_day_3: 搭建后台管理系统Django自带的admin

1.后台管理系统的特点:权限管理.少前端样式.快速开发 2.Django自带的admin后台管理系统,新建项目时会自动建立,admin也可以看成一个app 运行了程序打开链接:http://127.0.0.1:8000/admin/,就进入了后台管理系统登录页面 3.新建超级用户: Tools 工具栏运行 run manage.py Task 输入:createsuperuser,再根据提示输入用户名.邮箱.密码 4.登录成功: 5.把系统语言设置为中文与设置本地时间:修改MxOnline/se

4、Django实战第4天:xadmin快速搭建后台管理系统

Django默认为我们提供了后台管理系统admin, urls.py中配置的第一条就是访问后台管理系统admin的 urlpatterns = [ url(r'^admin/', admin.site.urls), ] 启动服务,访问127.0.0.1:8000/admin即可访问,访问后台需要验证,但是Django并没有为我们自动创建账号密码,Django提供了命令,让我们自己创建超级用户 现在我们可以用刚刚创建的超级用户登录进去(账号:admin 密码:admin123456) 原文地址:h

Bootstrap Table急速完美搭建后台管理系统

Bootstrap Table是基于 Bootstrap 的 jQuery 表格插件,通过简单的设置,就可以拥有强大的单选.多选.排序.分页,以及编辑.导出.过滤(扩展)等等的功能:http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/ 现在做的一个app管理以及后台配置系统,需要针对不同的城市作相应的定制化的配置,对一些后台数据也做一些展示和操作,所以每一个模块基本都会有表格的展现形式,这样做的好处就是直观方便操作.对于用什么t

vue+elementui搭建后台管理界面(3侧边栏菜单)

上一节搭好了主框架,但是标签页和侧边栏只是分别展示了各自的菜单,如何将二者联动起来? 定义路由规则:当有 children 属性时,从 children 里取出 path 填充到侧边栏,如: { path: '/', redirect: '/dashboard', name: 'Container', component: Container, children: [ {path: 'dashboard', name: '首页', component: Dashboard, }, {path: