前言:
在线使用Easy Mock可视化工具,可以提供快速生成“模拟数据”的持久化服务;
Mock.js是一个JS插件,指定了一套规范,而Easy Mock工具就遵循这些规范。
一、Easy Mock的使用
1、官网地址:https://www.studyinghome.com/login
登录
注册自定义项目
创建
创建接口
规范格式:
{ "msg": "获取动作列表成功!", "code": "success", "data": { "pageCount": 3, "pageNumber": 1, "count": 24, "pageSize": 8, "content": [ { "id": 71648445, "name": "cmdMovenext", "action": "movenext", "billnumber": "mdfsystem", "target": null, "ruleid": null, "svcurl": "/bill/movenext", "httpmethod": "GET", "subid": "DD", "system": 0, "parameter": "{"isWeb":"false"}", "authid": null, "pubts": "2020-01-04T18:05:11.000+0000", "tenant_id": "0" }, { "id": 71648444, "name": "cmdMoveprev", "action": "moveprev", "billnumber": "mdfsystem", "target": null, "ruleid": null, "svcurl": "/bill/moveprev", "httpmethod": "GET", "subid": "DD", "system": 0, "parameter": "{"isWeb":"false"}", "authid": null, "pubts": "2020-01-04T18:04:51.000+0000", "tenant_id": "0" }, { "id": 71648461, "name": "cmdQueryTree", "action": "querytree", "billnumber": "mdfsystem", "target": null, "ruleid": null, "svcurl": "/bill/querytree", "httpmethod": "POST", "subid": "DD", "system": 0, "parameter": "{"isWeb":"false"}", "authid": null, "pubts": "2019-12-27T19:43:17.000+0000", "tenant_id": "0" }, { "id": 71648458, "name": "cmdExport", "action": "batchoutput", "billnumber": "mdfsystem", "target": null, "ruleid": null, "svcurl": "/bill/export", "httpmethod": "POST", "subid": "DD", "system": 0, "parameter": "{"isWeb":"false"}", "authid": null, "pubts": "2019-12-27T19:43:16.000+0000", "tenant_id": "0" }, { "id": 71648459, "name": "cmdBatchDelete", "action": "batchdelete", "billnumber": "mdfsystem", "target": null, "ruleid": null, "svcurl": "/bill/batchdelete", "httpmethod": "POST", "subid": "DD", "system": 0, "parameter": "{"isWeb":"false"}", "authid": null, "pubts": "2019-12-27T19:43:16.000+0000", "tenant_id": "0" }, { "id": 71648457, "name": "cmdTempexport", "action": "tempexport", "billnumber": "mdfsystem", "target": null, "ruleid": null, "svcurl": "/billtemp/export", "httpmethod": "POST", "subid": "DD", "system": 0, "parameter": "{"isWeb":"false"}", "authid": null, "pubts": "2019-12-27T19:43:15.000+0000", "tenant_id": "0" }, { "id": 71648454, "name": "cmdBatchSubmit", "action": "batchsubmit", "billnumber": "mdfsystem", "target": null, "ruleid": null, "svcurl": "/bill/batchsubmit", "httpmethod": "POST", "subid": "DD", "system": 0, "parameter": "{"isWeb":"false"}", "authid": null, "pubts": "2019-12-27T19:43:14.000+0000", "tenant_id": "0" }, { "id": 71648455, "name": "cmdBatchRevoke", "action": "batchunaudit", "billnumber": "mdfsystem", "target": null, "ruleid": null, "svcurl": "/bill/batchunsubmit", "httpmethod": "POST", "subid": "DD", "system": 0, "parameter": "{"isWeb":"false"}", "authid": null, "pubts": "2019-12-27T19:43:14.000+0000", "tenant_id": "0" } ] } }