(window.webpackJsonp=window.webpackJsonp||[]).push([[181],{VwnK:function(q,M,e){"use strict";e.r(M);var ee=e("+L6B"),I=e("2/Rp"),te=e("OaEy"),v=e("2fM7"),ae=e("14J3"),y=e("BMrR"),_e=e("5NDa"),A=e("5rEg"),ne=e("jCWc"),i=e("kPKH"),T=e("jrin"),K=e("WmNS"),O=e.n(K),re=e("miYZ"),W=e("tsqr"),U=e("k1fw"),b=e("9og8"),se=e("y8nQ"),m=e("Vl3Y"),D=e("tJVT"),F=e("PpiC"),o=e("q1tI"),t=e.n(o),S=e("9kvl"),V=e("ErOA"),x=e("xKgJ"),z=e("Ot1p"),N=function(l){var f,p,c,le=l.user,ue=l.globalSetting,oe=l.loading,j=l.dispatch,u=l.restful,g=Object(F.a)(l,["user","globalSetting","loading","dispatch","restful"]),$=Object(o.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),B=Object(D.a)($,2),de=B[0],ie=B[1],J=Object(o.useState)(!0),C=Object(D.a)(J,2),me=C[0],w=C[1],s=g.match.params,Y=m.a.useForm(),G=Object(D.a)(Y,1),P=G[0],H=Object(o.useState)(`

    
##### \u7B80\u8981\u63CF\u8FF0

- \u7528\u6237\u6CE8\u518C\u63A5\u53E3

##### \u8BF7\u6C42URL
- \` http://xx.com/api/user/register \`
  
##### \u8BF7\u6C42\u65B9\u5F0F
- POST 

##### \u53C2\u6570

|\u53C2\u6570\u540D|\u5FC5\u9009|\u7C7B\u578B|\u8BF4\u660E|
|:----    |:---|:----- |-----   |
|username |\u662F  |string |\u7528\u6237\u540D   |
|password |\u662F  |string | \u5BC6\u7801    |
|name     |\u5426  |string | \u6635\u79F0    |

##### \u8FD4\u56DE\u793A\u4F8B 

\`\`\` 
  {
    "error_code": 0,
    "data": {
      "uid": "1",
      "username": "12154545",
      "name": "\u5434\u7CFB\u6302",
      "groupid": 2 ,
      "reg_time": "1436864169",
      "last_login_time": "0",
    }
  }
\`\`\`

##### \u8FD4\u56DE\u53C2\u6570\u8BF4\u660E 

|\u53C2\u6570\u540D|\u7C7B\u578B|\u8BF4\u660E|
|:-----  |:-----|-----                           |
|groupid |int   |\u7528\u6237\u7EC4id\uFF0C1\uFF1A\u8D85\u7EA7\u7BA1\u7406\u5458\uFF1B2\uFF1A\u666E\u901A\u7528\u6237  |

##### \u5907\u6CE8 

- \u66F4\u591A\u8FD4\u56DE\u9519\u8BEF\u4EE3\u7801\u8BF7\u770B\u9996\u9875\u7684\u9519\u8BEF\u4EE3\u7801\u63CF\u8FF0



\u6B22\u8FCE\u4F7F\u7528\uFF01`),L=Object(D.a)(H,2),Q=L[0],Z=L[1];Object(o.useEffect)(function(){P.resetFields()},[s.id]);var X=function(){var n=Object(b.a)(O.a.mark(function _(a){var h,r,R;return O.a.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,P.getFieldsValue();case 2:return h=d.sent,r="/api/restfuls.json",s.id!=0&&(r="/api/restfuls/".concat(s.id,".json")),d.next=7,Object(V.a)(r,{method:s.id!=0?"put":"post",body:Object(U.a)(Object(U.a)({file_type:0},h),{},{parent_id:h.parent_id||""})});case 7:R=d.sent,R.status===0&&(W.b.success("\u6DFB\u52A0\u6210\u529F"),g.history.push("/ch/rest/".concat(R.data.id)));case 9:case"end":return d.stop()}},_)}));return function(a){return n.apply(this,arguments)}}(),k=function(){var n=Object(b.a)(O.a.mark(function _(){var a;return O.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,j({type:"restful/getRestful"});case 2:if(!(s.id!=0)){r.next=8;break}return r.next=5,j({type:"restful/getRestfulDetail",payload:Object(U.a)({},s)});case 5:a=r.sent,P.setFieldsValue({description:a==null?void 0:a.description,name:a==null?void 0:a.name}),Object(x.p)()||g.history.replace("/403");case 8:case"end":return r.stop()}},_)}));return function(){return n.apply(this,arguments)}}();return Object(o.useEffect)(function(){var n,_;if(((n=u.restful)===null||n===void 0?void 0:n.data)&&P.setFieldsValue({parent_id:s.categoryId*1}),((_=u.restfulDetail)===null||_===void 0?void 0:_.description)&&s.id!=0){var a;Z((a=u.restfulDetail)===null||a===void 0?void 0:a.description)}},[u.restful,(f=u.restfulDetail)===null||f===void 0?void 0:f.description]),Object(o.useEffect)(function(){w(!0),k()},[s.id]),t.a.createElement("section",null,t.a.createElement("aside",{className:"edu-container mt30"},t.a.createElement(m.a,{onFinish:X,form:P,initialValues:Object(T.a)({},"name","")},t.a.createElement(y.a,{className:"mt30"},t.a.createElement(i.a,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),t.a.createElement(i.a,{flex:"1"},t.a.createElement(m.a.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},t.a.createElement(A.a,{placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26 ",maxLength:60})))),t.a.createElement(y.a,{className:""},t.a.createElement(i.a,{flex:"80px",className:"font14"},"\u6240\u5C5E\u76EE\u5F55:"),t.a.createElement(i.a,{flex:"1"},t.a.createElement(m.a.Item,{name:"parent_id",rules:[{required:!0,message:"\u6240\u5C5E\u76EE\u5F55"}]},t.a.createElement(v.a,{showSearch:!0,style:{width:200},placeholder:"\u8BF7\u9009\u62E9\u76EE\u5F55",optionFilterProp:"children",filterOption:function(_,a){return a.children.toLowerCase().indexOf(_.toLowerCase())>=0}},t.a.createElement(v.a.Option,{value:0,key:9999},"\u6839\u76EE\u5F55"),u==null||((p=u.restful)===null||p===void 0||((c=p.data)===null||c===void 0))?void 0:c.map(function(n,_){return t.a.createElement(v.a.Option,{value:n.id,key:_},n.title)}))))),t.a.createElement(m.a.Item,{name:"description",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},t.a.createElement(z.a,{defaultValue:Q,watch:!0,height:600})),t.a.createElement(y.a,{align:"middle",justify:"center"},t.a.createElement(i.a,null,t.a.createElement(I.a,{style:{width:130},size:"large",type:"primary",htmlType:"submit"},"\u4FDD\u5B58"))),t.a.createElement("div",{className:"mt40"}))))};M.default=Object(S.a)(function(E){var l=E.user,f=E.loading,p=E.globalSetting,c=E.restful;return{user:l,globalSetting:p,restful:c,loading:f.models.index}})(N)}}]);
