text: webpackJsonp([11],{306:function(e,t,l){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var l=0;l<t.length;l++){var a=t[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,l,a){return l&&e(t.prototype,l),a&&e(t,a),t}}(),d=l(1),m=a(d),s=l(18);l(437);var o=function(){return m.default.createElement("div",null,m.default.createElement("ul",null,m.default.createElement("li",null,"先引入jQuery插件"),m.default.createElement("li",null,"再引入基础插件"),m.default.createElement("li",null,"最后引入RAP jQuery插件")),m.default.createElement("h4",null,"示例代码"),m.default.createElement("pre",{className:"code-example"},"<script src=\"jquery.min.js\"></script>\n<script src=\"http://rap2api.taobao.org/app/plugin/:projectId\"></script>\n<script src=\"http://rap2api.taobao.org/libs/jquery.rap.js\"></script>\n$.ajax({\n    url : '/example/1501049256513', // 自动拦截\n    method : 'GET',\n    dataType : 'JSON',\n    success : function(data) {\n      // 返回根据RAP文档及规则生成的mock数据\n      $('#result').html(JSON.stringify(data))\n    }\n})\n"))},f=function(e){function t(e){n(this,t);var l=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return l.state={showExampleJQuery:!1},l}return u(t,e),c(t,[{key:"render",value:function(){var e=this;return m.default.createElement("section",{className:"APIList"},m.default.createElement("div",{className:"header"},m.default.createElement("span",{className:"title"},"接口")),m.default.createElement("div",{className:"body"},m.default.createElement("div",{className:"API"},m.default.createElement("div",{className:"title"},"获取仓库的完整数据（JSON）"),m.default.createElement("ul",null,m.default.createElement("li",null,m.default.createElement("code",null,s.serve,"/repository/get?id=:repositoryId")))),m.default.createElement("div",{className:"API"},m.default.createElement("div",{className:"title"},"获取接口的完整数据（JSON）"),m.default.createElement("ul",null,m.default.createElement("li",null,m.default.createElement("code",null,s.serve,"/interface/get?id=:interfaceId")))),m.default.createElement("div",{className:"API"},m.default.createElement("div",{className:"title"},"获取仓库的前端插件（JS）"),m.default.createElement("ul",null,m.default.createElement("li",null,m.default.createElement("span",{className:"label"},"基础插件"),m.default.createElement("code",null,s.serve,"/app/plugin/:repositories")),m.default.createElement("li",null,m.default.createElement("span",{className:"label"},"jQuery 插件"),m.default.createElement("code",null,s.serve,"/libs/jquery.rap.js"),m.default.createElement("a",{href:"#",className:"btn btn-secondary btn-sm ml8",onClick:function(t){t.preventDefault(),e.setState(function(e,t){return{showExampleJQuery:!e.showExampleJQuery}})}},"用法")),this.state.showExampleJQuery&&m.default.createElement(o,null),m.default.createElement("li",null,m.default.createElement("span",{className:"label"},"Mock.js 插件"),m.default.createElement("code",null,s.serve,"/libs/mock.rap.js")),m.default.createElement("li",null,m.default.createElement("span",{className:"label"},"fetch 插件"),m.default.createElement("code",null,s.serve,"/libs/fetch.rap.js")))),m.default.createElement("div",{className:"API"},m.default.createElement("div",{className:"title"},"获取单个接口的数据（JSON）"),m.default.createElement("ul",null,m.default.createElement("li",null,m.default.createElement("code",null,s.serve,"/app/mock/data/:interfaceId?scope=response|request"),m.default.createElement("table",{className:"table table-bordered mt12"},m.default.createElement("thead",null,m.default.createElement("tr",null,m.default.createElement("th",{width:"140"},m.default.createElement("code",null,"scope")),m.default.createElement("th",null,"描述"))),m.default.createElement("tbody",null,m.default.createElement("tr",null,m.default.createElement("td",null,m.default.createElement("code",null,"response")),m.default.createElement("td",null,"获取单个接口的响应数据（JSON）")),m.default.createElement("tr",null,m.default.createElement("td",null,m.default.createElement("code",null,"request")),m.default.createElement("td",null,"获取单个接口的请求数据（JSON）"))))),m.default.createElement("li",null,m.default.createElement("code",null,s.serve,"/app/mock/:repositoryId/:method/:url")))),m.default.createElement("div",{className:"API"},m.default.createElement("div",{className:"title"},"获取单个接口的模板（JSON）"),m.default.createElement("ul",null,m.default.createElement("li",null,m.default.createElement("code",null,s.serve,"/app/mock/template/:interfaceId?scope=response|request"),m.default.createElement("table",{className:"table table-bordered mt12"},m.default.createElement("thead",null,m.default.createElement("tr",null,m.default.createElement("th",{width:"140"},m.default.createElement("code",null,"scope")),m.default.createElement("th",null,"描述"))),m.default.createElement("tbody",null,m.default.createElement("tr",null,m.default.createElement("td",null,m.default.createElement("code",null,"response")),m.default.createElement("td",null,"获取单个接口的响应模板（JSON）")),m.default.createElement("tr",null,m.default.createElement("td",null,m.default.createElement("code",null,"request")),m.default.createElement("td",null,"获取单个接口的请求模板（JSON）"))))))),m.default.createElement("div",{className:"API"},m.default.createElement("div",{className:"title"},"获取单个接口的模板（JSON Schema）"),m.default.createElement("ul",null,m.default.createElement("li",null,m.default.createElement("code",null,s.serve,"/app/mock/schema/:interfaceId?scope=response|request"),m.default.createElement("table",{className:"table table-bordered mt12"},m.default.createElement("thead",null,m.default.createElement("tr",null,m.default.createElement("th",{width:"140"},m.default.createElement("code",null,"scope")),m.default.createElement("th",null,"描述"))),m.default.createElement("tbody",null,m.default.createElement("tr",null,m.default.createElement("td",null,m.default.createElement("code",null,"response")),m.default.createElement("td",null,"获取单个接口的响应模板（JSON Schema）")),m.default.createElement("tr",null,m.default.createElement("td",null,m.default.createElement("code",null,"request")),m.default.createElement("td",null,"获取单个接口的请求模板（JSON Schema）")))))))))}}]),t}(m.default.Component);t.default=f},420:function(e,t,l){t=e.exports=l(22)(),t.push([e.id,".APIList{padding:2rem}.APIList>.header{margin-bottom:2rem}.APIList>.header .title{font-size:2rem}.APIList>.body>.API{margin-bottom:2rem}.APIList>.body>.API>.title{font-size:1.6rem;margin-bottom:1rem}.APIList>.body>.API>ul{padding-left:2rem}.APIList>.body>.API>ul li{margin-bottom:.75rem}.APIList>.body>.API>ul li .label{margin-right:.5rem}.APIList>.body>.API code{padding:.5rem}.code-example{padding:2rem;margin:2rem}",""])},437:function(e,t,l){var a=l(420);"string"==typeof a&&(a=[[e.id,a,""]]);l(24)(a,{});a.locals&&(e.exports=a.locals)}});
  //# sourceMappingURL=11.44e1256a.chunk.js.map