侧边栏壁纸
博主头像
吾非媛

将自己工作中遇到的问题记录下来 希望可以帮助到需要的人

  • 累计撰写 23 篇文章
  • 累计创建 14 个标签
  • 累计收到 0 条评论

Ant Designer Vue版本去除Mock数据

吾非媛
2021-02-22 / 0 评论 / 0 点赞 / 261 阅读 / 17,386 字
温馨提示:
本文最后更新于 2021-02-22,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。
  1. 先配置代理
    // development server port 8000
    port: 8000,
    // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
    proxy: {
      '/api': {
        // target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro',
        target: 'http://127.0.0.1:8081',
        ws: false,
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }

2.去掉Mock
修改main.js

// import './mock'

3.需要构建的接口与返回数据内容

  • /auth/login Post
  • 权限数据
  "code":200,
  "result": {
    "role": {
      "id": "admin",
      "name": "管理员",
      "describe": "拥有所有权限",
      "status": 1,
      "creatorId": "system",
      "createTime": 1497160610259,
      "deleted": 0,
      "permissions": [
        {
          "roleId": "admin",
          "permissionId": "dashboard",
          "permissionName": "仪表盘",
          "actions": [
            {
              "action": "add",
              "defaultCheck": false,
              "describe": "新增"
            },
            {
              "action": "query",
              "defaultCheck": false,
              "describe": "查询"
            },
            {
              "action": "get",
              "defaultCheck": false,
              "describe": "详情"
            },
            {
              "action": "update",
              "defaultCheck": false,
              "describe": "修改"
            },
            {
              "action": "delete",
              "defaultCheck": false,
              "describe": "删除"
            }
          ],
          "actionEntitySet": [
            {
              "action": "add",
              "describe": "新增",
              "defaultCheck": false
            },
            {
              "action": "query",
              "describe": "查询",
              "defaultCheck": false
            },
            {
              "action": "get",
              "describe": "详情",
              "defaultCheck": false
            },
            {
              "action": "update",
              "describe": "修改",
              "defaultCheck": false
            },
            {
              "action": "delete",
              "describe": "删除",
              "defaultCheck": false
            }
          ],
          "actionList": null,
          "dataAccess": null
        },
        {
          "roleId": "admin",
          "permissionId": "exception",
          "permissionName": "异常页面权限",
          "actions": [
            {
              "action": "add",
              "defaultCheck": false,
              "describe": "新增"
            },
            {
              "action": "query",
              "defaultCheck": false,
              "describe": "查询"
            },
            {
              "action": "get",
              "defaultCheck": false,
              "describe": "详情"
            },
            {
              "action": "update",
              "defaultCheck": false,
              "describe": "修改"
            },
            {
              "action": "delete",
              "defaultCheck": false,
              "describe": "删除"
            }
          ],
          "actionEntitySet": [
            {
              "action": "add",
              "describe": "新增",
              "defaultCheck": false
            },
            {
              "action": "query",
              "describe": "查询",
              "defaultCheck": false
            },
            {
              "action": "get",
              "describe": "详情",
              "defaultCheck": false
            },
            {
              "action": "update",
              "describe": "修改",
              "defaultCheck": false
            },
            {
              "action": "delete",
              "describe": "删除",
              "defaultCheck": false
            }
          ],
          "actionList": null,
          "dataAccess": null
        },
        {
          "roleId": "admin",
          "permissionId": "result",
          "permissionName": "结果权限",
          "actions": [
            {
              "action": "add",
              "defaultCheck": false,
              "describe": "新增"
            },
            {
              "action": "query",
              "defaultCheck": false,
              "describe": "查询"
            },
            {
              "action": "get",
              "defaultCheck": false,
              "describe": "详情"
            },
            {
              "action": "update",
              "defaultCheck": false,
              "describe": "修改"
            },
            {
              "action": "delete",
              "defaultCheck": false,
              "describe": "删除"
            }
          ],
          "actionEntitySet": [
            {
              "action": "add",
              "describe": "新增",
              "defaultCheck": false
            },
            {
              "action": "query",
              "describe": "查询",
              "defaultCheck": false
            },
            {
              "action": "get",
              "describe": "详情",
              "defaultCheck": false
            },
            {
              "action": "update",
              "describe": "修改",
              "defaultCheck": false
            },
            {
              "action": "delete",
              "describe": "删除",
              "defaultCheck": false
            }
          ],
          "actionList": null,
          "dataAccess": null
        },
        {
          "roleId": "admin",
          "permissionId": "profile",
          "permissionName": "详细页权限",
          "actions": [
            {
              "action": "add",
              "defaultCheck": false,
              "describe": "新增"
            },
            {
              "action": "query",
              "defaultCheck": false,
              "describe": "查询"
            },
            {
              "action": "get",
              "defaultCheck": false,
              "describe": "详情"
            },
            {
              "action": "update",
              "defaultCheck": false,
              "describe": "修改"
            },
            {
              "action": "delete",
              "defaultCheck": false,
              "describe": "删除"
            }
          ],
          "actionEntitySet": [
            {
              "action": "add",
              "describe": "新增",
              "defaultCheck": false
            },
            {
              "action": "query",
              "describe": "查询",
              "defaultCheck": false
            },
            {
              "action": "get",
              "describe": "详情",
              "defaultCheck": false
            },
            {
              "action": "update",
              "describe": "修改",
              "defaultCheck": false
            },
            {
              "action": "delete",
              "describe": "删除",
              "defaultCheck": false
            }
          ],
          "actionList": null,
          "dataAccess": null
        },
        {
          "roleId": "admin",
          "permissionId": "table",
          "permissionName": "表格权限",
          "actions": [
            {
              "action": "add",
              "defaultCheck": false,
              "describe": "新增"
            },
            {
              "action": "import",
              "defaultCheck": false,
              "describe": "导入"
            },
            {
              "action": "get",
              "defaultCheck": false,
              "describe": "详情"
            },
            {
              "action": "update",
              "defaultCheck": false,
              "describe": "修改"
            }
          ],
          "actionEntitySet": [
            {
              "action": "add",
              "describe": "新增",
              "defaultCheck": false
            },
            {
              "action": "import",
              "describe": "导入",
              "defaultCheck": false
            },
            {
              "action": "get",
              "describe": "详情",
              "defaultCheck": false
            },
            {
              "action": "update",
              "describe": "修改",
              "defaultCheck": false
            }
          ],
          "actionList": null,
          "dataAccess": null
        },
        {
          "roleId": "admin",
          "permissionId": "form",
          "permissionName": "表单权限",
          "actions": [
            {
              "action": "add",
              "defaultCheck": false,
              "describe": "新增"
            },
            {
              "action": "get",
              "defaultCheck": false,
              "describe": "详情"
            },
            {
              "action": "query",
              "defaultCheck": false,
              "describe": "查询"
            },
            {
              "action": "update",
              "defaultCheck": false,
              "describe": "修改"
            },
            {
              "action": "delete",
              "defaultCheck": false,
              "describe": "删除"
            }
          ],
          "actionEntitySet": [
            {
              "action": "add",
              "describe": "新增",
              "defaultCheck": false
            },
            {
              "action": "get",
              "describe": "详情",
              "defaultCheck": false
            },
            {
              "action": "query",
              "describe": "查询",
              "defaultCheck": false
            },
            {
              "action": "update",
              "describe": "修改",
              "defaultCheck": false
            },
            {
              "action": "delete",
              "describe": "删除",
              "defaultCheck": false
            }
          ],
          "actionList": null,
          "dataAccess": null
        },
        {
          "roleId": "admin",
          "permissionId": "order",
          "permissionName": "订单管理",
          "actions": [
            {
              "action": "add",
              "defaultCheck": false,
              "describe": "新增"
            },
            {
              "action": "query",
              "defaultCheck": false,
              "describe": "查询"
            },
            {
              "action": "get",
              "defaultCheck": false,
              "describe": "详情"
            },
            {
              "action": "update",
              "defaultCheck": false,
              "describe": "修改"
            },
            {
              "action": "delete",
              "defaultCheck": false,
              "describe": "删除"
            }
          ],
          "actionEntitySet": [
            {
              "action": "add",
              "describe": "新增",
              "defaultCheck": false
            },
            {
              "action": "query",
              "describe": "查询",
              "defaultCheck": false
            },
            {
              "action": "get",
              "describe": "详情",
              "defaultCheck": false
            },
            {
              "action": "update",
              "describe": "修改",
              "defaultCheck": false
            },
            {
              "action": "delete",
              "describe": "删除",
              "defaultCheck": false
            }
          ],
          "actionList": null,
          "dataAccess": null
        },
        {
          "roleId": "admin",
          "permissionId": "permission",
          "permissionName": "权限管理",
          "actions": [
            {
              "action": "add",
              "defaultCheck": false,
              "describe": "新增"
            },
            {
              "action": "get",
              "defaultCheck": false,
              "describe": "详情"
            },
            {
              "action": "update",
              "defaultCheck": false,
              "describe": "修改"
            },
            {
              "action": "delete",
              "defaultCheck": false,
              "describe": "删除"
            }
          ],
          "actionEntitySet": [
            {
              "action": "add",
              "describe": "新增",
              "defaultCheck": false
            },
            {
              "action": "get",
              "describe": "详情",
              "defaultCheck": false
            },
            {
              "action": "update",
              "describe": "修改",
              "defaultCheck": false
            },
            {
              "action": "delete",
              "describe": "删除",
              "defaultCheck": false
            }
          ],
          "actionList": null,
          "dataAccess": null
        },
        {
          "roleId": "admin",
          "permissionId": "role",
          "permissionName": "角色管理",
          "actions": [
            {
              "action": "add",
              "defaultCheck": false,
              "describe": "新增"
            },
            {
              "action": "get",
              "defaultCheck": false,
              "describe": "详情"
            },
            {
              "action": "update",
              "defaultCheck": false,
              "describe": "修改"
            },
            {
              "action": "delete",
              "defaultCheck": false,
              "describe": "删除"
            }
          ],
          "actionEntitySet": [
            {
              "action": "add",
              "describe": "新增",
              "defaultCheck": false
            },
            {
              "action": "get",
              "describe": "详情",
              "defaultCheck": false
            },
            {
              "action": "update",
              "describe": "修改",
              "defaultCheck": false
            },
            {
              "action": "delete",
              "describe": "删除",
              "defaultCheck": false
            }
          ],
          "actionList": null,
          "dataAccess": null
        },
        {
          "roleId": "admin",
          "permissionId": "table",
          "permissionName": "桌子管理",
          "actions": [
            {
              "action": "add",
              "defaultCheck": false,
              "describe": "新增"
            },
            {
              "action": "get",
              "defaultCheck": false,
              "describe": "详情"
            },
            {
              "action": "query",
              "defaultCheck": false,
              "describe": "查询"
            },
            {
              "action": "update",
              "defaultCheck": false,
              "describe": "修改"
            },
            {
              "action": "delete",
              "defaultCheck": false,
              "describe": "删除"
            }
          ],
          "actionEntitySet": [
            {
              "action": "add",
              "describe": "新增",
              "defaultCheck": false
            },
            {
              "action": "get",
              "describe": "详情",
              "defaultCheck": false
            },
            {
              "action": "query",
              "describe": "查询",
              "defaultCheck": false
            },
            {
              "action": "update",
              "describe": "修改",
              "defaultCheck": false
            },
            {
              "action": "delete",
              "describe": "删除",
              "defaultCheck": false
            }
          ],
          "actionList": null,
          "dataAccess": null
        },
        {
          "roleId": "admin",
          "permissionId": "user",
          "permissionName": "用户管理",
          "actions": [
            {
              "action": "add",
              "defaultCheck": false,
              "describe": "新增"
            },
            {
              "action": "import",
              "defaultCheck": false,
              "describe": "导入"
            },
            {
              "action": "get",
              "defaultCheck": false,
              "describe": "详情"
            },
            {
              "action": "update",
              "defaultCheck": false,
              "describe": "修改"
            },
            {
              "action": "delete",
              "defaultCheck": false,
              "describe": "删除"
            },
            {
              "action": "export",
              "defaultCheck": false,
              "describe": "导出"
            }
          ],
          "actionEntitySet": [
            {
              "action": "add",
              "describe": "新增",
              "defaultCheck": false
            },
            {
              "action": "import",
              "describe": "导入",
              "defaultCheck": false
            },
            {
              "action": "get",
              "describe": "详情",
              "defaultCheck": false
            },
            {
              "action": "update",
              "describe": "修改",
              "defaultCheck": false
            },
            {
              "action": "delete",
              "describe": "删除",
              "defaultCheck": false
            },
            {
              "action": "export",
              "describe": "导出",
              "defaultCheck": false
            }
          ],
          "actionList": null,
          "dataAccess": null
        }
      ]
    }
  }
}

0
博主关闭了当前页面的评论