React+mock实现简单源代码

上传者: niuch1029291561 | 上传时间: 2021-07-13 14:40:38 | 文件大小: 12KB | 文件类型: ZIP
提供了以下mock接口的demo,更多源码请下载附件信息 const compuser_data = '/api/compuser/data'; const compuser_findById = '/api/compuser/findById'; const compuser_save = '/api/compuser/save'; const compuser_del = '/api/compuser/del'; const userinfo = '/api/userinfo'; const query = '/user/query'; const page = '/user/page'; const find = '/user/findById'; const del = '/user/del'; /* mockjs语法参考官网http://mockjs.com/ */ const Mock = require('mockjs'); const userinfo = '/api/userinfo'; const loginData = Mock.mock({ username: 'guest', sex: '男', age: 18 }); module.exports = { [`POST ${userinfo}`](req, res) { res.json(loginData); }, [`GET ${userinfo}`](req, res) { res.json(loginData); } };

文件下载

资源详情

[{"title":"( 11 个子文件 12KB ) React+mock实现简单源代码","children":[{"title":"mock","children":[{"title":"js","children":[{"title":"DataUtils.js <span style='color:#111;'> 5.20KB </span>","children":null,"spread":false},{"title":"demo.js <span style='color:#111;'> 350B </span>","children":null,"spread":false},{"title":"user_demo.js <span style='color:#111;'> 6.93KB </span>","children":null,"spread":false},{"title":"compuser.js <span style='color:#111;'> 6.41KB </span>","children":null,"spread":false}],"spread":true},{"title":"public","children":[{"title":"readme.md <span style='color:#111;'> 207B </span>","children":null,"spread":false}],"spread":true},{"title":"_server-js.js <span style='color:#111;'> 2.13KB </span>","children":null,"spread":false},{"title":"json","children":[{"title":"datasource.json <span style='color:#111;'> 182B </span>","children":null,"spread":false},{"title":"compuser","children":[{"title":"compuser.json <span style='color:#111;'> 3.19KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"_server.js <span style='color:#111;'> 862B </span>","children":null,"spread":false},{"title":"server.js <span style='color:#111;'> 437B </span>","children":null,"spread":false},{"title":"_server-json.js <span style='color:#111;'> 4.35KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • u010819284 :
    还算不错吧
    2020-07-23

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明