text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-bbcceb8e"],{"021b":function(t,e,a){"use strict";a("7003")},"19ce":function(t,e,a){"use strict";a.d(e,"f",(function(){return s})),a.d(e,"c",(function(){return o})),a.d(e,"b",(function(){return r})),a.d(e,"e",(function(){return i})),a.d(e,"a",(function(){return c})),a.d(e,"d",(function(){return l}));var n=a("66df"),s=function(t){return n["b"].request({url:"InterfaceGroup/index",method:"get",params:t})},o=function(t){return n["b"].request({url:"InterfaceGroup/del",method:"get",params:{hash:t}})},r=function(t,e){return n["b"].request({url:"InterfaceGroup/changeStatus",method:"get",params:{status:t,id:e}})},i=function(){return n["b"].request({url:"InterfaceGroup/getAll",method:"get"})},c=function(t){return n["b"].request({url:"InterfaceGroup/add",method:"post",data:t})},l=function(t){return n["b"].request({url:"InterfaceGroup/edit",method:"post",data:t})}},2226:function(t,e,a){"use strict";a.d(e,"e",(function(){return s})),a.d(e,"g",(function(){return o})),a.d(e,"f",(function(){return r})),a.d(e,"c",(function(){return i})),a.d(e,"b",(function(){return c})),a.d(e,"a",(function(){return l})),a.d(e,"d",(function(){return u}));var n=a("66df"),s=function(){return n["b"].request({url:"InterfaceList/getHash",method:"get"})},o=function(){return n["b"].request({url:"InterfaceList/refresh",method:"get"})},r=function(t){return n["b"].request({url:"InterfaceList/index",method:"get",params:t})},i=function(t){return n["b"].request({url:"InterfaceList/del",method:"get",params:{hash:t}})},c=function(t,e){return n["b"].request({url:"InterfaceList/changeStatus",method:"get",params:{status:t,hash:e}})},l=function(t){return n["b"].request({url:"InterfaceList/add",method:"post",data:t})},u=function(t){return n["b"].request({url:"InterfaceList/edit",method:"post",data:t})}},7003:function(t,e,a){},cc76:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("Row",[a("Col",{attrs:{span:"24"}},[a("Card",{staticClass:"margin-bottom-10"},[a("Form",{attrs:{inline:""}},[a("FormItem",{staticClass:"margin-bottom-0"},[a("Select",{staticStyle:{width:"120px"},attrs:{clearable:"",placeholder:"请选择状态"},model:{value:t.searchConf.status,callback:function(e){t.$set(t.searchConf,"status",e)},expression:"searchConf.status"}},[a("Option",{attrs:{value:1}},[t._v("启用")]),a("Option",{attrs:{value:0}},[t._v("禁用")])],1)],1),a("FormItem",{staticClass:"margin-bottom-0"},[a("Select",{staticStyle:{width:"120px"},attrs:{clearable:"",placeholder:"请选择类别"},model:{value:t.searchConf.type,callback:function(e){t.$set(t.searchConf,"type",e)},expression:"searchConf.type"}},[a("Option",{attrs:{value:1}},[t._v("接口标识")]),a("Option",{attrs:{value:2}},[t._v("接口名称")]),a("Option",{attrs:{value:3}},[t._v("真实类库")])],1)],1),a("FormItem",{staticClass:"margin-bottom-0"},[a("Input",{attrs:{placeholder:""},model:{value:t.searchConf.keywords,callback:function(e){t.$set(t.searchConf,"keywords",e)},expression:"searchConf.keywords"}})],1),a("FormItem",{staticClass:"margin-bottom-0"},[a("Button",{attrs:{type:"primary"},on:{click:t.search}},[t._v(t._s(t.$t("find_button"))+"/"+t._s(t.$t("refresh_button")))])],1)],1)],1)],1)],1),a("Row",[a("Col",{attrs:{span:"24"}},[a("Card",[a("div",{staticClass:"margin-bottom-15"},[a("Button",{directives:[{name:"has",rawName:"v-has",value:"InterfaceList/add",expression:"'InterfaceList/add'"}],attrs:{type:"primary",icon:"md-add"},on:{click:t.alertAdd}},[t._v(t._s(t.$t("add_button")))]),a("Button",{directives:[{name:"has",rawName:"v-has",value:"InterfaceList/refresh",expression:"'InterfaceList/refresh'"}],staticClass:"margin-left-5",attrs:{type:"warning",icon:"md-refresh"},on:{click:function(e){t.confirmRefresh=!0}}},[t._v("刷新路由")]),a("Button",{staticClass:"margin-left-5",attrs:{type:"info",to:"/wiki/list",icon:"md-bookmarks"}},[t._v("接口文档")])],1),a("div",[a("Table",{attrs:{loading:t.listLoading,columns:t.columnsList,data:t.tableData,border:"","disabled-hover":""}})],1),a("div",{staticClass:"margin-top-15",staticStyle:{"text-align":"center"}},[a("Page",{attrs:{total:t.tableShow.listCount,current:t.tableShow.currentPage,"page-size":t.tableShow.pageSize,"show-elevator":"","show-sizer":"","show-total":""},on:{"on-change":t.changePage,"on-page-size-change":t.changeSize}})],1)])],1)],1),a("Modal",{attrs:{width:"668",styles:{top:"30px"}},on:{"on-visible-change":t.doCancel},model:{value:t.modalSetting.show,callback:function(e){t.$set(t.modalSetting,"show",e)},expression:"modalSetting.show"}},[a("p",{staticStyle:{color:"#2d8cf0"},attrs:{slot:"header"},slot:"header"},[a("Icon",{attrs:{type:"md-alert"}}),a("span",[t._v(t._s(t.formItem.id?"编辑":"新增")+"接口")])],1),a("Form",{ref:"myForm",attrs:{rules:t.ruleValidate,model:t.formItem,"label-width":90}},[a("FormItem",{attrs:{label:"接口名称",prop:"info"}},[a("Input",{attrs:{placeholder:"请输入接口名称"},model:{value:t.formItem.info,callback:function(e){t.$set(t.formItem,"info",e)},expression:"formItem.info"}})],1),a("FormItem",{attrs:{label:"真实类库",prop:"api_class"}},[a("Input",{attrs:{placeholder:"请输入真实类库"},model:{value:t.formItem.api_class,callback:function(e){t.$set(t.formItem,"api_class",e)},expression:"formItem.api_class"}})],1),a("FormItem",{attrs:{label:"接口分组",prop:"group_hash"}},[a("Select",{staticStyle:{width:"200px"},model:{value:t.formItem.group_hash,callback:function(e){t.$set(t.formItem,"group_hash",e)},expression:"formItem.group_hash"}},t._l(t.apiGroup,(function(e,n){return a("Option",{key:e.hash,attrs:{value:e.hash,kk:n}},[t._v(" "+t._s(e.name))])})),1)],1),a("FormItem",{attrs:{label:"请求方式",prop:"method"}},[a("Select",{staticStyle:{width:"200px"},model:{value:t.formItem.method,callback:function(e){t.$set(t.formItem,"method",e)},expression:"formItem.method"}},[a("Option",{key:0,attrs:{value:0}},[t._v(" 不限")]),a("Option",{key:1,attrs:{value:1}},[t._v(" POST")]),a("Option",{key:2,attrs:{value:2}},[t._v(" GET")])],1),a("Tooltip",{attrs:{placement:"right","max-width":"800"}},[a("Icon",{staticClass:"margin-left-5",attrs:{type:"md-help-circle",color:"#2d8cf0",size:"20"}}),a("div",{attrs:{slot:"content"},slot:"content"},[a("p",[t._v("请注意：这里所配置的请求方式，将兼容Access-Token的获取方式，比如，当前接口允许使用GET请求，那么系统将会识别GET参数中的Access-Token。")])])],1)],1),a("FormItem",{attrs:{label:"接口映射",prop:"hash"}},[a("Input",{staticStyle:{width:"300px"},attrs:{disabled:""},model:{value:t.formItem.hash,callback:function(e){t.$set(t.formItem,"hash",e)},expression:"formItem.hash"}}),a("Tag",{staticClass:"margin-left-5",attrs:{color:"error"}},[t._v("系统自动生成，不允许修改")])],1),a("FormItem",{attrs:{label:"AccessToken",prop:"access_token"}},[a("Select",{staticStyle:{width:"200px"},model:{value:t.formItem.access_token,callback:function(e){t.$set(t.formItem,"access_token",e)},expression:"formItem.access_token"}},[a("Option",{key:0,attrs:{value:0}},[t._v(" 简易认证")]),a("Option",{key:1,attrs:{value:1}},[t._v(" 复杂认证")])],1),a("Tooltip",{attrs:{placement:"right","max-width":"800"}},[a("Icon",{staticClass:"margin-left-5",attrs:{type:"md-help-circle",color:"#2d8cf0",size:"20"}}),a("div",{attrs:{slot:"content"},slot:"content"},[a("p",[t._v("新版本的全部接口都必须在Header中传递access-token字段，所以AccessToken必须要验证。")]),a("p",[t._v("简易认证：在请求这类接口时候，请直接在header中传递AppSecret即可，终身有效。")]),a("p",[t._v("复杂认证：在请求这类接口时候，先请求getAccessToken接口获取可用的AccessToken，记住这里的AccessToken默认只有2小时的有效期。")])])],1)],1),a("FormItem",{attrs:{label:"路由模式",prop:"hash_type"}},[a("Select",{staticStyle:{width:"200px"},model:{value:t.formItem.hash_type,callback:function(e){t.$set(t.formItem,"hash_type",e)},expression:"formItem.hash_type"}},[a("Option",{key:1,attrs:{value:1}},[t._v(" 普通模式")]),a("Option",{key:2,attrs:{value:2}},[t._v(" 加密模式")])],1),a("Tooltip",{attrs:{placement:"right","max-width":"800"}},[a("Icon",{staticClass:"margin-left-5",attrs:{type:"md-help-circle",color:"#2d8cf0",size:"20"}}),a("div",{attrs:{slot:"content"},slot:"content"},[a("p",[t._v("普通模式：接口将不采用hash映射，会直接使用真实类库来请求。")]),a("p",[t._v("加密模式：接口将采用hash映射，以达到隐藏真实类库的目的。")])])],1)],1),a("FormItem",{attrs:{label:"测试模式",prop:"is_test"}},[a("Select",{staticStyle:{width:"200px"},model:{value:t.formItem.is_test,callback:function(e){t.$set(t.formItem,"is_test",e)},expression:"formItem.is_test"}},[a("Option",{key:0,attrs:{value:0}},[t._v(" 生产模式")]),a("Option",{key:1,attrs:{value:1}},[t._v(" 测试模式")])],1)],1)],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("Button",{staticClass:"margin-right-10",attrs:{type:"text"},on:{click:t.cancel}},[t._v("取消")]),a("Button",{attrs:{type:"primary",loading:t.modalSetting.loading},on:{click:t.submit}},[t._v("确定")])],1)],1),a("Modal",{attrs:{width:"360"},model:{value:t.confirmRefresh,callback:function(e){t.confirmRefresh=e},expression:"confirmRefresh"}},[a("p",{staticStyle:{color:"#f60","text-align":"center"},attrs:{slot:"header"},slot:"header"},[a("Icon",{attrs:{type:"information-circled"}}),a("span",[t._v("确定要刷新路由么")])],1),a("div",{staticStyle:{"text-align":"center"}},[a("p",[t._v("刷新路由是一个非常危险的操作，它有可能影响到您现有接口的访问，请确认无误后刷新！！")])]),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("Button",{attrs:{type:"error",size:"large",long:"",loading:t.refreshLoading},on:{click:t.refreshRoute}},[t._v("确定刷新")])],1)])],1)},s=[],o=a("2226"),r=a("19ce"),i=function(t,e,a,n){if(t.buttonShow.edit)return e("Button",{props:{type:"primary"},style:{margin:"0 5px"},on:{click:function(){t.formItem.id=a.id,t.formItem.api_class=a.api_class,t.formItem.info=a.info,t.formItem.method=a.method,t.formItem.hash=a.hash,t.formItem.group_hash=a.group_hash,t.formItem.access_token=a.access_token,t.formItem.is_test=a.is_test,t.formItem.hash_type=a.hash_type,t.modalSetting.show=!0,t.modalSetting.index=n}}},t.$t("edit_button"))},c=function(t,e,a,n){if(t.buttonShow.del)return e("Poptip",{props:{confirm:!0,title:"您确定要删除这条数据吗? ",transfer:!0},on:{"on-ok":function(){Object(o["c"])(a.hash).then((function(e){a.loading=!1,t.tableData.splice(n,1),t.$Message.success(e.data.msg)}))}}},[e("Button",{style:{margin:"0 5px"},props:{type:"error",placement:"top",loading:a.isDeleting}},t.$t("delete_button"))])},l=function(t,e,a,n){if(t.buttonShow.request)return e("Button",{style:{margin:"0 5px"},props:{type:"info",placement:"top",loading:a.isDeleting},on:{click:function(){var e=a.hash;t.$router.push({path:"request/".concat(e)})}}},"请求参数")},u=function(t,e,a,n){if(t.buttonShow.response)return e("Button",{style:{margin:"0 5px"},props:{type:"warning",placement:"top",loading:a.isDeleting},on:{click:function(){var e=a.hash;t.$router.push({path:"response/".concat(e)})}}},"返回参数")},h={name:"interface_list",data:function(){var t=this;return{confirmRefresh:!1,refreshLoading:!1,columnsList:[{title:"序号",type:"index",width:65,align:"center"},{title:"接口名称",align:"center",minWidth:190,key:"info"},{title:"真实类库",align:"center",key:"api_class",width:230},{title:"接口映射",align:"center",key:"hash",width:140},{title:"请求方式",align:"center",width:95,render:function(t,e){if(1===e.row.isTest)return t("tag",{attrs:{color:"error"}},"测试");switch(e.row.method){case 1:return t("Tag",{attrs:{color:"success"}},"POST");case 2:return t("Tag",{attrs:{color:"primary"}},"GET");case 0:return t("Tag",{attrs:{color:"warning"}},"不限")}}},{title:"接口状态",align:"center",width:130,render:function(e,a){var n=t;return e("i-switch",{attrs:{size:"large"},props:{"true-value":1,"false-value":0,value:a.row.status,disabled:!n.buttonShow.changeStatus},on:{"on-change":function(t){Object(o["b"])(t,a.row.hash).then((function(t){n.$Message.success(t.data.msg),n.getList()}))}}},[e("span",{slot:"open"},n.$t("open_choose")),e("span",{slot:"close"},n.$t("close_choose"))])}},{title:"操作",align:"center",minWidth:375,render:function(e,a){return e("div",[i(t,e,a.row,a.index),l(t,e,a.row,a.index),u(t,e,a.row,a.index),c(t,e,a.row,a.index)])}}],tableData:[],apiGroup:[],tableShow:{currentPage:1,pageSize:10,listCount:0},searchConf:{type:"",keywords:"",status:""},modalSetting:{show:!1,loading:!1,index:0},formItem:{api_class:"",info:"",group_hash:"default",method:2,hash_type:2,hash:"",access_token:0,is_test:0,id:0},ruleValidate:{api_class:[{required:!0,message:"真实类库不能为空",trigger:"blur"}],info:[{required:!0,message:"接口名称不能为空",trigger:"blur"}]},buttonShow:{edit:!0,request:!0,response:!0,del:!0,changeStatus:!0},listLoading:!1}},created:function(){var t=this;t.getList(),t.hasRule("InterfaceList/edit").then((function(e){t.buttonShow.edit=e})),t.hasRule("InterfaceList/del").then((function(e){t.buttonShow.del=e})),t.hasRule("InterfaceList/changeStatus").then((function(e){t.buttonShow.changeStatus=e})),t.hasRule("Fields/response").then((function(e){t.buttonShow.response=e})),t.hasRule("Fields/request").then((function(e){t.buttonShow.request=e})),Object(r["e"])().then((function(e){t.apiGroup=e.data.data.list}))},activated:function(){var t=this;Object(r["e"])().then((function(e){t.apiGroup=e.data.data.list}))},methods:{alertAdd:function(){var t=this;Object(o["e"])().then((function(e){t.formItem.hash=e.data.data.hash})),t.modalSetting.show=!0},submit:function(){var t=this;this.$refs["myForm"].validate((function(e){e&&(t.modalSetting.loading=!0,0===t.formItem.id?Object(o["a"])(t.formItem).then((function(e){t.modalSetting.loading=!1,t.$Message.success(e.data.msg),t.getList(),t.cancel()})).catch((function(){t.modalSetting.loading=!1})):Object(o["d"])(t.formItem).then((function(e){t.modalSetting.loading=!1,t.$Message.success(e.data.msg),t.getList(),t.cancel()})).catch((function(){t.modalSetting.loading=!1})))}))},cancel:function(){this.modalSetting.show=!1},changePage:function(t){this.tableShow.currentPage=t,this.getList()},changeSize:function(t){this.tableShow.pageSize=t,this.getList()},search:function(){this.tableShow.currentPage=1,this.getList()},getList:function(){var t=this;t.listLoading=!0,Object(o["f"])({page:t.tableShow.currentPage,size:t.tableShow.pageSize,type:t.searchConf.type,keywords:t.searchConf.keywords,status:t.searchConf.status}).then((function(e){t.tableData=e.data.data.list,t.tableShow.listCount=e.data.data.count,t.listLoading=!1}))},doCancel:function(t){t||(this.formItem.id=0,this.$refs["myForm"].resetFields(),this.modalSetting.loading=!1,this.modalSetting.index=0)},refreshRoute:function(){var t=this;t.refreshLoading=!0,Object(o["g"])().then((function(e){t.$Message.success(e.data.msg),t.confirmRefresh=!1,t.refreshLoading=!1})).catch((function(){t.confirmRefresh=!1,t.refreshLoading=!1}))}}},d=h,m=(a("021b"),a("2877")),f=Object(m["a"])(d,n,s,!1,null,"083504bc",null);e["default"]=f.exports}}]);