支持path参数

This commit is contained in:
暮光:城中城
2021-11-20 21:45:29 +08:00
parent ce84b4fee9
commit b432e9fa17
28 changed files with 2496 additions and 641 deletions

View File

@@ -1 +1 @@
import{O as p,T as d,r,o as t,c as s,w as a,a as o,p as f,t as c,b as i,n as g,e as D,d as y,F as I}from"./vendor.ee21a423.js";import{_ as S}from"./main.b335ea75.js";const v={setup(){const l=p(),m=d(()=>l.state.swaggerDoc),w=d(()=>l.state.swaggerDoc.info),e=d(()=>l.state.methodStatistic);return{swaggerDoc:m,swaggerDocInfo:w,methodStatistic:e}}},x=["href"],E=["href"],L=["innerHTML"],O={key:1,style:{"text-align":"center"}};function A(l,m,w,e,C,N){const n=r("a-form-item"),T=r("a-statistic"),u=r("a-card"),h=r("a-col"),b=r("a-row"),k=r("a-form");return t(),s(u,null,{default:a(()=>[e.swaggerDocInfo?(t(),s(k,{key:0,"label-col":{span:4},"wrapper-col":{span:20}},{default:a(()=>[o(n,{label:"\u6807\u9898"},{default:a(()=>[f(c(e.swaggerDocInfo.title),1)]),_:1}),o(n,{label:"\u7248\u672C"},{default:a(()=>[f(c(e.swaggerDocInfo.version),1)]),_:1}),e.swaggerDocInfo.contact?(t(),s(n,{key:0,label:"\u4F5C\u8005"},{default:a(()=>[f(c(e.swaggerDocInfo.contact.name)+" "+c(e.swaggerDocInfo.contact.email)+" ",1),e.swaggerDocInfo.contact.url?(t(),i("a",{key:0,href:e.swaggerDocInfo.contact.url,target:"_blank"},c(e.swaggerDocInfo.contact.url),9,x)):g("",!0)]),_:1})):g("",!0),o(n,{label:"host"},{default:a(()=>[f(c(e.swaggerDoc.host),1)]),_:1}),e.swaggerDocInfo.license?(t(),s(n,{key:1,label:"\u8BB8\u53EF\u8BC1"},{default:a(()=>[D("a",{href:e.swaggerDocInfo.license.url,target:"_blank"},c(e.swaggerDocInfo.license.name),9,E)]),_:1})):g("",!0),o(n,{label:"\u6587\u6863\u8BF4\u660E"},{default:a(()=>[D("span",{innerHTML:e.swaggerDocInfo.description},null,8,L)]),_:1}),o(n,{label:"\u63A5\u53E3\u7EDF\u8BA1"},{default:a(()=>[o(b,{gutter:[16,16]},{default:a(()=>[(t(),i(I,null,y(["GET","POST","PUT","DELETE","HEAD","PATCH","OPTIONS","TRACE","TOTAL"],_=>(t(),i(I,null,[e.methodStatistic[_]?(t(),s(h,{key:0,span:6},{default:a(()=>[o(u,{size:"small"},{default:a(()=>[o(T,{title:_==="TOTAL"?"\u603B\u8BA1":_+"\u65B9\u6CD5",value:e.methodStatistic[_],suffix:"\u4E2A"},null,8,["title","value"])]),_:2},1024)]),_:2},1024)):g("",!0)],64))),64))]),_:1})]),_:1})]),_:1})):(t(),i("div",O,"\u6682\u65E0\u6587\u6863\u4FE1\u606F\uFF0C\u8BF7\u5148\u9009\u62E9\u6587\u6863"))]),_:1})}var P=S(v,[["render",A]]);export{P as default};
import{J as p,P as d,r,o as t,c as s,w as a,a as o,m as f,t as c,b as i,k as g,e as D,d as y,F as I}from"./vendor.81c025df.js";import{_ as S}from"./main.dfeb60bb.js";const v={setup(){const l=p(),m=d(()=>l.state.swaggerDoc),w=d(()=>l.state.swaggerDoc.info),e=d(()=>l.state.methodStatistic);return{swaggerDoc:m,swaggerDocInfo:w,methodStatistic:e}}},x=["href"],E=["href"],L=["innerHTML"],A={key:1,style:{"text-align":"center"}};function C(l,m,w,e,N,O){const n=r("a-form-item"),b=r("a-statistic"),u=r("a-card"),T=r("a-col"),h=r("a-row"),k=r("a-form");return t(),s(u,null,{default:a(()=>[e.swaggerDocInfo?(t(),s(k,{key:0,"label-col":{span:4},"wrapper-col":{span:20}},{default:a(()=>[o(n,{label:"\u6807\u9898"},{default:a(()=>[f(c(e.swaggerDocInfo.title),1)]),_:1}),o(n,{label:"\u7248\u672C"},{default:a(()=>[f(c(e.swaggerDocInfo.version),1)]),_:1}),e.swaggerDocInfo.contact?(t(),s(n,{key:0,label:"\u4F5C\u8005"},{default:a(()=>[f(c(e.swaggerDocInfo.contact.name)+" "+c(e.swaggerDocInfo.contact.email)+" ",1),e.swaggerDocInfo.contact.url?(t(),i("a",{key:0,href:e.swaggerDocInfo.contact.url,target:"_blank"},c(e.swaggerDocInfo.contact.url),9,x)):g("",!0)]),_:1})):g("",!0),o(n,{label:"host"},{default:a(()=>[f(c(e.swaggerDoc.host),1)]),_:1}),e.swaggerDocInfo.license?(t(),s(n,{key:1,label:"\u8BB8\u53EF\u8BC1"},{default:a(()=>[D("a",{href:e.swaggerDocInfo.license.url,target:"_blank"},c(e.swaggerDocInfo.license.name),9,E)]),_:1})):g("",!0),o(n,{label:"\u6587\u6863\u8BF4\u660E"},{default:a(()=>[D("span",{innerHTML:e.swaggerDocInfo.description},null,8,L)]),_:1}),o(n,{label:"\u63A5\u53E3\u7EDF\u8BA1"},{default:a(()=>[o(h,{gutter:[16,16]},{default:a(()=>[(t(),i(I,null,y(["GET","POST","PUT","DELETE","HEAD","PATCH","OPTIONS","TRACE","TOTAL"],_=>(t(),i(I,null,[e.methodStatistic[_]?(t(),s(T,{key:0,span:6},{default:a(()=>[o(u,{size:"small"},{default:a(()=>[o(b,{title:_==="TOTAL"?"\u603B\u8BA1":_+"\u65B9\u6CD5",value:e.methodStatistic[_],suffix:"\u4E2A"},null,8,["title","value"])]),_:2},1024)]),_:2},1024)):g("",!0)],64))),64))]),_:1})]),_:1})]),_:1})):(t(),i("div",A,"\u6682\u65E0\u6587\u6863\u4FE1\u606F\uFF0C\u8BF7\u5148\u9009\u62E9\u6587\u6863"))]),_:1})}var H=S(v,[["render",C]]);export{H as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
var V=Object.defineProperty,N=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var w=(o,t,a)=>t in o?V(o,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[t]=a,x=(o,t)=>{for(var a in t||(t={}))D.call(t,a)&&w(o,a,t[a]);if(k)for(var a of k(t))I.call(t,a)&&w(o,a,t[a]);return o},B=(o,t)=>N(o,b(t));import{a as apiClient,z as zyplayerApi,g as getZyplayerApiBaseUrl}from"./custom.33a00f74.js";import{_ as _export_sfc}from"./main.b335ea75.js";import{r as resolveComponent,o as openBlock,c as createBlock,w as withCtx,e as createBaseVNode,t as toDisplayString,a as createVNode,n as createCommentVNode,p as createTextVNode,D as DownOutlined,U as UserOutlined,b as createElementBlock,q as withModifiers,F as Fragment,S as StarOutlined,s as SettingOutlined,C as CarryOutOutlined,u as FileTextOutlined,v as DashboardOutlined,I as InfoCircleOutlined,d as renderList,x as withDirectives,y as vShow,B as BarChartOutlined,M as MenuFoldOutlined,G as MenuUnfoldOutlined,H as pushScopeId,J as popScopeId}from"./vendor.ee21a423.js";const customApi={get:(o,t)=>apiClient({url:o,method:"get",data:t}),post:(o,t)=>apiClient({url:o,method:"post",data:t})},_sfc_main$5={data(){return{aboutDialogVisible:!1,upgradeInfo:{}}},mounted(){this.checkSystemUpgrade()},methods:{show(){this.aboutDialogVisible=!0},checkSystemUpgrade(){zyplayerApi.systemUpgradeInfo({}).then(o=>{o.data&&(this.upgradeInfo=o.data,this.upgradeInfo.upgradeContent&&(this.upgradeInfo.upgradeContent=this.upgradeInfo.upgradeContent.replaceAll("\uFF1B",`
var V=Object.defineProperty,N=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var w=(o,t,a)=>t in o?V(o,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[t]=a,x=(o,t)=>{for(var a in t||(t={}))D.call(t,a)&&w(o,a,t[a]);if(k)for(var a of k(t))I.call(t,a)&&w(o,a,t[a]);return o},B=(o,t)=>N(o,b(t));import{a as apiClient,z as zyplayerApi,g as getZyplayerApiBaseUrl}from"./custom.fa34986e.js";import{_ as _export_sfc}from"./main.dfeb60bb.js";import{r as resolveComponent,o as openBlock,c as createBlock,w as withCtx,e as createBaseVNode,t as toDisplayString,a as createVNode,k as createCommentVNode,m as createTextVNode,D as DownOutlined,U as UserOutlined,b as createElementBlock,n as withModifiers,F as Fragment,S as StarOutlined,p as SettingOutlined,C as CarryOutOutlined,q as FileTextOutlined,s as DashboardOutlined,I as InfoCircleOutlined,d as renderList,u as withDirectives,v as vShow,B as BarChartOutlined,M as MenuFoldOutlined,x as MenuUnfoldOutlined,y as pushScopeId,E as popScopeId}from"./vendor.81c025df.js";const customApi={get:(o,t)=>apiClient({url:o,method:"get",data:t}),post:(o,t)=>apiClient({url:o,method:"post",data:t})},_sfc_main$5={data(){return{aboutDialogVisible:!1,upgradeInfo:{}}},mounted(){this.checkSystemUpgrade()},methods:{show(){this.aboutDialogVisible=!0},checkSystemUpgrade(){zyplayerApi.systemUpgradeInfo({}).then(o=>{o.data&&(this.upgradeInfo=o.data,this.upgradeInfo.upgradeContent&&(this.upgradeInfo.upgradeContent=this.upgradeInfo.upgradeContent.replaceAll("\uFF1B",`
`),console.log(`zyplayer-doc\u53D1\u73B0\u65B0\u7248\u672C\uFF1A
\u5347\u7EA7\u5730\u5740\uFF1A`+o.data.upgradeUrl+`
\u5F53\u524D\u7248\u672C\uFF1A`+o.data.nowVersion+`

View File

@@ -1 +1 @@
var P=Object.defineProperty;var T=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var I=(c,e,l)=>e in c?P(c,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):c[e]=l,V=(c,e)=>{for(var l in e||(e={}))B.call(e,l)&&I(c,l,e[l]);if(T)for(var l of T(e))G.call(e,l)&&I(c,l,e[l]);return c};import{z as D}from"./custom.33a00f74.js";import{O as N,P as x,Q as U,r as v,o,b as r,e as F,a as s,w as n,F as f,c as k,t as S,n as g,p as i}from"./vendor.ee21a423.js";import{_ as K}from"./main.b335ea75.js";const j={setup(){const c=N();let e=x([]),l=x(!1);const a=async()=>{d.value={},l.value=!0,D.docSwaggerGlobalParamList().then(t=>{setTimeout(()=>l.value=!1,500),e.value=t.data||[],c.commit("setGlobalParam",e.value)})};let d=x({}),w=x();const p=()=>{d.value.isEdit&&y(d.value);let t={isEdit:!0};e.value.unshift(t),d.value=t,setTimeout(()=>{let _=document.getElementsByClassName("ant-table-body")[0];_.scrollTop=0},0)},C=t=>{d.value.isEdit&&y(d.value),t.isEdit=!0,d.value=V({},t)},y=t=>{t.isEdit=!1,t.id?e.value.forEach(_=>_.isEdit=!1):e.value=e.value.filter(_=>_!==t),d.value={}},L=t=>{D.docSwaggerGlobalParamUpdate(d.value).then(_=>{t.isEdit=!1,a()})},h=async t=>{D.docSwaggerGlobalParamUpdate({id:t.id,yn:0}).then(_=>{a()})};return U(()=>{a()}),{docList:e,docListLoading:l,docEdit:d,tableRef:w,searchDocList:a,deleteDoc:h,editDoc:C,saveEditDoc:L,cancelEditDoc:y,addDocLine:p,docListColumns:[{title:"\u53C2\u6570\u540D\u79F0",dataIndex:"paramKey",width:250},{title:"\u53C2\u6570\u503C",dataIndex:"paramValue"},{title:"\u53C2\u6570\u4F4D\u7F6E",dataIndex:"paramType",width:120},{title:"\u64CD\u4F5C",dataIndex:"operation",fixed:"right",width:170}]}}},z={style:{"margin-bottom":"10px","text-align":"right"}},H=i("\u5237\u65B0"),A=i("\u65B0\u5EFA"),M={key:1},O={key:1},Q=i("Form"),R=i("Header"),q=i("Cookie"),J=i("Form"),W=i("Header"),X=i("Cookie"),Y=i("\u53D6\u6D88"),Z=i("\u4FDD\u5B58"),$=i("\u7F16\u8F91"),ee=i("\u5220\u9664");function ae(c,e,l,a,d,w){const p=v("a-button"),C=v("a-input"),y=v("a-select-option"),L=v("a-select"),h=v("a-tag"),t=v("a-popconfirm"),_=v("a-table");return o(),r(f,null,[F("div",z,[s(p,{onClick:a.searchDocList,type:"primary"},{default:n(()=>[H]),_:1},8,["onClick"]),s(p,{onClick:a.addDocLine},{default:n(()=>[A]),_:1},8,["onClick"])]),s(_,{dataSource:a.docList,columns:a.docListColumns,size:"middle",id:"paramTable",loading:a.docListLoading,pagination:!1,scroll:{x:1e3,y:"calc(100vh - 240px)"}},{bodyCell:n(({column:b,text:E,record:m})=>[b.dataIndex==="paramKey"?(o(),r(f,{key:0},[m.isEdit?(o(),k(C,{key:0,placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u540D\u79F0",value:a.docEdit.paramKey,"onUpdate:value":e[0]||(e[0]=u=>a.docEdit.paramKey=u)},null,8,["value"])):(o(),r("span",M,S(E),1))],64)):g("",!0),b.dataIndex==="paramValue"?(o(),r(f,{key:1},[m.isEdit?(o(),k(C,{key:0,rows:1,placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u503C",value:a.docEdit.paramValue,"onUpdate:value":e[1]||(e[1]=u=>a.docEdit.paramValue=u)},null,8,["value"])):(o(),r("span",O,S(E),1))],64)):g("",!0),b.dataIndex==="paramType"?(o(),r(f,{key:2},[m.isEdit?(o(),k(L,{key:0,placeholder:"\u53C2\u6570\u4F4D\u7F6E",value:a.docEdit.paramType,"onUpdate:value":e[2]||(e[2]=u=>a.docEdit.paramType=u),style:{width:"110px"}},{default:n(()=>[s(y,{value:1},{default:n(()=>[Q]),_:1}),s(y,{value:2},{default:n(()=>[R]),_:1}),s(y,{value:3},{default:n(()=>[q]),_:1})]),_:1},8,["value"])):(o(),r(f,{key:1},[E===1?(o(),k(h,{key:0,color:"green"},{default:n(()=>[J]),_:1})):E===2?(o(),k(h,{key:1,color:"pink"},{default:n(()=>[W]),_:1})):E===3?(o(),k(h,{key:2,color:"pink"},{default:n(()=>[X]),_:1})):g("",!0)],64))],64)):g("",!0),b.dataIndex==="operation"?(o(),r(f,{key:3},[m.isEdit?(o(),r(f,{key:0},[s(p,{type:"link",onClick:u=>a.cancelEditDoc(m)},{default:n(()=>[Y]),_:2},1032,["onClick"]),s(p,{type:"link",onClick:u=>a.saveEditDoc(m)},{default:n(()=>[Z]),_:2},1032,["onClick"])],64)):(o(),r(f,{key:1},[s(p,{type:"link",onClick:u=>a.editDoc(m)},{default:n(()=>[$]),_:2},1032,["onClick"]),s(t,{title:"\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F",onConfirm:u=>a.deleteDoc(m)},{default:n(()=>[s(p,{type:"link",danger:""},{default:n(()=>[ee]),_:1})]),_:2},1032,["onConfirm"])],64))],64)):g("",!0)]),_:1},8,["dataSource","columns","loading","scroll"])],64)}var ie=K(j,[["render",ae]]);export{ie as default};
var N=Object.defineProperty;var T=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var I=(c,e,l)=>e in c?N(c,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):c[e]=l,V=(c,e)=>{for(var l in e||(e={}))B.call(e,l)&&I(c,l,e[l]);if(T)for(var l of T(e))G.call(e,l)&&I(c,l,e[l]);return c};import{z as D}from"./custom.fa34986e.js";import{J as P,L as x,N as U,r as v,o,b as r,e as F,a as s,w as n,F as f,c as k,t as S,k as g,m as i}from"./vendor.81c025df.js";import{_ as K}from"./main.dfeb60bb.js";const j={setup(){const c=P();let e=x([]),l=x(!1);const a=async()=>{d.value={},l.value=!0,D.docSwaggerGlobalParamList().then(t=>{setTimeout(()=>l.value=!1,500),e.value=t.data||[],c.commit("setGlobalParam",e.value)})};let d=x({}),w=x();const m=()=>{d.value.isEdit&&y(d.value);let t={isEdit:!0};e.value.unshift(t),d.value=t,setTimeout(()=>{let _=document.getElementsByClassName("ant-table-body")[0];_.scrollTop=0},0)},C=t=>{d.value.isEdit&&y(d.value),t.isEdit=!0,d.value=V({},t)},y=t=>{t.isEdit=!1,t.id?e.value.forEach(_=>_.isEdit=!1):e.value=e.value.filter(_=>_!==t),d.value={}},L=t=>{D.docSwaggerGlobalParamUpdate(d.value).then(_=>{t.isEdit=!1,a()})},h=async t=>{D.docSwaggerGlobalParamUpdate({id:t.id,yn:0}).then(_=>{a()})};return U(()=>{a()}),{docList:e,docListLoading:l,docEdit:d,tableRef:w,searchDocList:a,deleteDoc:h,editDoc:C,saveEditDoc:L,cancelEditDoc:y,addDocLine:m,docListColumns:[{title:"\u53C2\u6570\u540D\u79F0",dataIndex:"paramKey",width:250},{title:"\u53C2\u6570\u503C",dataIndex:"paramValue"},{title:"\u53C2\u6570\u4F4D\u7F6E",dataIndex:"paramType",width:120},{title:"\u64CD\u4F5C",dataIndex:"operation",fixed:"right",width:170}]}}},z={style:{"margin-bottom":"10px","text-align":"right"}},H=i("\u5237\u65B0"),A=i("\u65B0\u5EFA"),J={key:1},M={key:1},R=i("Form"),q=i("Header"),O=i("Cookie"),Q=i("Form"),W=i("Header"),X=i("Cookie"),Y=i("\u53D6\u6D88"),Z=i("\u4FDD\u5B58"),$=i("\u7F16\u8F91"),ee=i("\u5220\u9664");function ae(c,e,l,a,d,w){const m=v("a-button"),C=v("a-input"),y=v("a-select-option"),L=v("a-select"),h=v("a-tag"),t=v("a-popconfirm"),_=v("a-table");return o(),r(f,null,[F("div",z,[s(m,{onClick:a.searchDocList,type:"primary"},{default:n(()=>[H]),_:1},8,["onClick"]),s(m,{onClick:a.addDocLine},{default:n(()=>[A]),_:1},8,["onClick"])]),s(_,{dataSource:a.docList,columns:a.docListColumns,size:"middle",id:"paramTable",loading:a.docListLoading,pagination:!1,scroll:{x:1e3,y:"calc(100vh - 240px)"}},{bodyCell:n(({column:b,text:E,record:p})=>[b.dataIndex==="paramKey"?(o(),r(f,{key:0},[p.isEdit?(o(),k(C,{key:0,placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u540D\u79F0",value:a.docEdit.paramKey,"onUpdate:value":e[0]||(e[0]=u=>a.docEdit.paramKey=u)},null,8,["value"])):(o(),r("span",J,S(E),1))],64)):g("",!0),b.dataIndex==="paramValue"?(o(),r(f,{key:1},[p.isEdit?(o(),k(C,{key:0,rows:1,placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u503C",value:a.docEdit.paramValue,"onUpdate:value":e[1]||(e[1]=u=>a.docEdit.paramValue=u)},null,8,["value"])):(o(),r("span",M,S(E),1))],64)):g("",!0),b.dataIndex==="paramType"?(o(),r(f,{key:2},[p.isEdit?(o(),k(L,{key:0,placeholder:"\u53C2\u6570\u4F4D\u7F6E",value:a.docEdit.paramType,"onUpdate:value":e[2]||(e[2]=u=>a.docEdit.paramType=u),style:{width:"110px"}},{default:n(()=>[s(y,{value:1},{default:n(()=>[R]),_:1}),s(y,{value:2},{default:n(()=>[q]),_:1}),s(y,{value:3},{default:n(()=>[O]),_:1})]),_:1},8,["value"])):(o(),r(f,{key:1},[E===1?(o(),k(h,{key:0,color:"green"},{default:n(()=>[Q]),_:1})):E===2?(o(),k(h,{key:1,color:"pink"},{default:n(()=>[W]),_:1})):E===3?(o(),k(h,{key:2,color:"pink"},{default:n(()=>[X]),_:1})):g("",!0)],64))],64)):g("",!0),b.dataIndex==="operation"?(o(),r(f,{key:3},[p.isEdit?(o(),r(f,{key:0},[s(m,{type:"link",onClick:u=>a.cancelEditDoc(p)},{default:n(()=>[Y]),_:2},1032,["onClick"]),s(m,{type:"link",onClick:u=>a.saveEditDoc(p)},{default:n(()=>[Z]),_:2},1032,["onClick"])],64)):(o(),r(f,{key:1},[s(m,{type:"link",onClick:u=>a.editDoc(p)},{default:n(()=>[$]),_:2},1032,["onClick"]),s(t,{title:"\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F",onConfirm:u=>a.deleteDoc(p)},{default:n(()=>[s(m,{type:"link",danger:""},{default:n(()=>[ee]),_:1})]),_:2},1032,["onConfirm"])],64))],64)):g("",!0)]),_:1},8,["dataSource","columns","loading","scroll"])],64)}var ie=K(j,[["render",ae]]);export{ie as default};

View File

@@ -1 +0,0 @@
import{_ as e}from"./main.b335ea75.js";import{o as t,b as o}from"./vendor.ee21a423.js";const n={name:"SettingView",components:{},data(){return{}},computed:{},mounted(){},methods:{}};function r(a,s,c,m,i,p){return t(),o("div",null," \u5C55\u793A\u914D\u7F6E\u9875\u9762 ")}var u=e(n,[["render",r]]);export{u as default};

View File

@@ -0,0 +1 @@
import{_ as e}from"./main.dfeb60bb.js";import{o as t,b as o}from"./vendor.81c025df.js";const n={name:"SettingView",components:{},data(){return{}},computed:{},mounted(){},methods:{}};function r(a,s,c,d,m,i){return t(),o("div",null," \u5C55\u793A\u914D\u7F6E\u9875\u9762 ")}var _=e(n,[["render",r]]);export{_ as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -5,9 +5,9 @@
<link rel="icon" href="logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Swagger文档管理</title>
<script type="module" crossorigin src="assets/main.b335ea75.js"></script>
<link rel="modulepreload" href="assets/vendor.ee21a423.js">
<link rel="stylesheet" href="assets/style.76731824.css">
<script type="module" crossorigin src="assets/main.dfeb60bb.js"></script>
<link rel="modulepreload" href="assets/vendor.81c025df.js">
<link rel="stylesheet" href="assets/style.b4cf285c.css">
</head>
<body>
<div id="app"></div>

File diff suppressed because it is too large Load Diff

View File

@@ -11,7 +11,6 @@
"ant-design-vue": "^3.0.0-alpha.8",
"axios": "^0.19.2",
"brace": "^0.11.1",
"element-plus": "^1.0.2-beta.71",
"highlight.js": "^11.3.1",
"jsontoxml": "^1.0.1",
"less": "^2.7.3",

View File

@@ -1,14 +1,11 @@
<template>
<el-config-provider :locale="localeEl">
<a-config-provider :locale="locale">
<router-view></router-view>
</a-config-provider>
</el-config-provider>
<a-config-provider :locale="locale">
<router-view></router-view>
</a-config-provider>
</template>
<script>
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import zhCnEl from 'element-plus/lib/locale/lang/zh-cn';
import 'moment/dist/locale/zh-cn';
export default {
name: 'app',
@@ -17,7 +14,6 @@
data() {
return {
locale: zhCN,
localeEl: zhCnEl,
};
},
methods: {}

View File

@@ -1,228 +0,0 @@
import formatjson from '../../assets/utils/formatjson'
/**
* 参数解析
* @author 暮光:城中城
* @since 2017年5月7日
*/
export default {
getRequestParamList(parameters, definitionsDataMap) {
if (!parameters) {
return [];
}
formatjson.annotationObject = {};
let requestParamList = [], requestParamExample = [];
Object.keys(parameters).forEach(key => {
let tempParameters = parameters[key];
let htmlStr = "", htmlStrExample = "";
let responsesJson = [];
let responsesExample = [];
let required = tempParameters.required;
let paramName = tempParameters.name || '';
let paramType = tempParameters.type || '';
let paramDesc = tempParameters.description || '';
let paramIn = tempParameters.in || '';
let example = tempParameters.example || tempParameters.default || '';
if (tempParameters.items) {
htmlStr = paramName + "[0]";
htmlStrExample = paramName + "[0]";
} else if (tempParameters.schema) {
if ("array" === tempParameters.schema.type) {
let responsesObj = definitionsDataMap[tempParameters.schema.items.$ref];
if (responsesObj != null) {
responsesJson[0] = this.getResponsesJson(responsesObj, "", false, 1, definitionsDataMap);
responsesExample[0] = this.getResponsesJson(responsesObj, "", true, 1, definitionsDataMap);
} else {
responsesJson = [""];
responsesExample = [""];
if (tempParameters.schema.items.type === "boolean") {
responsesJson = [true];
responsesExample = [true];
} else if (tempParameters.schema.items.type === "integer") {
responsesJson = [0];
responsesExample = [0];
}
}
if (tempParameters.schema.$ref) {
let arrTmp = tempParameters.schema.$ref.split("/");
paramType = arrTmp[arrTmp.length - 1];
}
htmlStr = formatjson.processObjectToHtmlPre(responsesJson, 0, false, false, false, true);
htmlStrExample = formatjson.processObjectToHtmlPre(responsesExample, 0, false, false, false, false);
} else if (tempParameters.schema.$ref) {
let responsesObj = definitionsDataMap[tempParameters.schema.$ref];
if (tempParameters.schema.$ref) {
let arrTmp = tempParameters.schema.$ref.split("/");
paramType = arrTmp[arrTmp.length - 1];
}
if (responsesObj) {
responsesJson = this.getResponsesJson(responsesObj, "", false, 1, definitionsDataMap);
responsesExample = this.getResponsesJson(responsesObj, "", true, 1, definitionsDataMap);
htmlStr = formatjson.processObjectToHtmlPre(responsesJson, 0, false, false, false, true);
htmlStrExample = formatjson.processObjectToHtmlPre(responsesExample, 0, false, false, false, false);
} else {
htmlStr = paramName;
htmlStrExample = paramName;
}
} else if ("string" === tempParameters.schema.type) {
htmlStr = paramName;
htmlStrExample = paramName;
} else {
htmlStr = paramName;
htmlStrExample = paramName;
}
} else {
htmlStr = paramName;
htmlStrExample = paramName;
}
requestParamList.push({htmlStr, paramDesc, paramType, paramIn, required});
requestParamExample.push({htmlStrExample, paramDesc, paramType, paramIn, required});
});
console.log(requestParamList);
console.log(requestParamExample);
return requestParamList;
},
getResponsesJson(responsesObj, prevRef, isExample, recursiveCount, definitionsDataMap) {
let responsesJson = {};
recursiveCount++;// 多层递归最多递归10层防止无限递归
if (!responsesObj || !responsesObj.properties || recursiveCount > 10) {
return responsesJson;
}
let requiredArr = responsesObj.required;
Object.keys(responsesObj.properties).forEach(prop => {
let tmpData = responsesObj.properties[prop];
if ("array" === tmpData.type) {// 数组
formatjson.annotationObject[prop] = tmpData.description || '';
if (prevRef !== tmpData.items.$ref) {
let tempObj = definitionsDataMap[tmpData.items.$ref];
if (tempObj != null) {
let tempArr = responsesJson[prop] = [];
tempArr[0] = this.getResponsesJson(tempObj, tmpData.items.$ref, isExample, recursiveCount, definitionsDataMap);
} else {
let responsesJsonSub = [];
let bodyFor = responsesJsonSub;
let items = tmpData.items;
for (let i = 0; i < 10; i++) {
if ("array" === items.type) {
bodyFor = bodyFor[0] = [];
items = items.items;
} else {
tempObj = definitionsDataMap[items.$ref];
if (tempObj != null) {
bodyFor[0] = this.getResponsesJson(tempObj, items.$ref, isExample, recursiveCount, definitionsDataMap);
} else {
if (items.type === "boolean") {
bodyFor[0] = true;
} else if (items.type === "integer") {
bodyFor[0] = 0;
} else {
bodyFor[0] = "";
}
}
break;
}
}
responsesJson[prop] = responsesJsonSub;
}
} else {
responsesJson[prop] = "{}" + (tmpData.description || '');
}
} else if (tmpData.$ref) {// 对象
formatjson.annotationObject[prop] = tmpData.description || '';
if (prevRef !== tmpData.$ref) {
let tempObj = definitionsDataMap[tmpData.$ref];
responsesJson[prop] = this.getResponsesJson(tempObj, tmpData.$ref, isExample, recursiveCount, definitionsDataMap);
} else {
responsesJson[prop] = "{}" + (tmpData.description || '');
}
} else {// 字段
let enumExample = "";
let enumObj = tmpData["enum"];
if (enumObj && enumObj.length > 0) {
enumExample = "枚举值:";
for (let i = 0; i < enumObj.length; i++) {
if (i > 0) {
enumExample += "、";
}
enumExample += enumObj[i];
}
}
let typeStr = tmpData.format || tmpData.type || '';
if (isExample) {
let tempVal = tmpData.example || '';
if (tempVal && enumExample) {
tempVal = tempVal + "" + enumExample;
}
responsesJson[prop] = tempVal;
} else {
if (requiredArr && requiredArr.indexOf(prop) >= 0) {
typeStr = (typeStr ? typeStr + "," : "") + "required";
}
if (typeStr) {
typeStr = "(" + typeStr + ")";
}
let descriptionStr = typeStr + tmpData.description || '';
if (descriptionStr && enumExample) {
descriptionStr = descriptionStr + "" + enumExample;
}
responsesJson[prop] = descriptionStr;
}
}
});
return responsesJson;
},
getResponseParamList(responses, definitionsDataMap) {
if (!responses) {
return [];
}
let responsesList = [];
formatjson.annotationObject = {};
Object.keys(responses).forEach(key => {
let tempRespones = responses[key];
if (tempRespones.schema) {
let responsesJson, responsesExample;
if ("array" === tempRespones.schema.type) {
responsesJson = [];
responsesExample = [];
let responsesObj = definitionsDataMap[tempRespones.schema.items.$ref];
if (responsesObj != null) {
responsesJson[0] = this.getResponsesJson(responsesObj, "", false, 1, definitionsDataMap);
responsesExample[0] = this.getResponsesJson(responsesObj, "", true, 1, definitionsDataMap);
} else {
responsesJson = [""];
responsesExample = [""];
if (tempRespones.schema.items.type === "boolean") {
responsesJson = [true];
responsesExample = [true];
} else if (tempRespones.schema.items.type === "integer") {
responsesJson = [0];
responsesExample = [0];
}
}
} else if (tempRespones.schema.$ref) {
let responsesObj = definitionsDataMap[tempRespones.schema.$ref];
if (!responsesObj) {
let arrTmp = tempRespones.schema.$ref.split("/");
let lastObjName = arrTmp[arrTmp.length - 1];
responsesJson = lastObjName;
responsesExample = lastObjName;
} else {
responsesJson = this.getResponsesJson(responsesObj, "", false, 1, definitionsDataMap);
responsesExample = this.getResponsesJson(responsesObj, "", true, 1, definitionsDataMap);
}
} else {
responsesJson = "";
responsesExample = "";
}
if (!responsesJson) {
return;
}
let htmlStr = formatjson.processObjectToHtmlPre(responsesJson, 0, false, false, false, true);
responsesList.push({code: key, desc: htmlStr});
htmlStr = formatjson.processObjectToHtmlPre(responsesExample, 0, false, false, false, false);
}
});
return responsesList;
}
}

View File

@@ -160,7 +160,7 @@ export default {
let type = definition.type;
let properties = definition.properties;
let indexSub = 1;
if (type === 'object') {
if (type === 'object' && properties) {
let currentLevelTypes = {};
Object.keys(properties).forEach(key => {
let parameter = properties[key];

View File

@@ -1,125 +0,0 @@
/**
* 将对象处理成json格式化和着色的html
* @author 暮光:城中城
* @since 2017年5月7日
*/
export default {
// 需要在对象或列表后面添加注释的对象,例:{userList: "用户列表"}
// 那么在名字为userList的对象或列表后面都会加上“用户列表” 这个注释
annotationObject: {},
tabStr: " ",
isArray: function(obj) {
return obj && typeof obj === 'object' && typeof obj.length === 'number'
&& !(obj.propertyIsEnumerable('length'));
},
processObjectToHtmlPre: function(obj, indent, addComma, isArray, isPropertyContent, showAnnotation) {
let htmlStr = this.processObject(obj, "", indent, addComma, isArray, isPropertyContent, showAnnotation);
htmlStr = '<pre class="json">' + htmlStr + '</pre>';
return htmlStr;
},
processObject: function(obj, keyName, indent, addComma, isArray, isPropertyContent, showAnnotation) {
let html = "";
let comma = (addComma) ? "<span class='comma'>,</span> " : "";
let type = typeof obj;
if (this.isArray(obj)) {
if (obj.length === 0) {
html += this.getRow(indent, "<span class='array-brace'>[ ]</span>" + comma, isPropertyContent);
} else {
let clpsHtml = '<span><img class="option-img" src="webjars/mg-ui/img/expanded.png" onClick="Formatjson.expImgClicked(this);" /></span><span class="collapsible">';
let annotation = '';
if(showAnnotation && keyName && this.annotationObject[keyName]) {
annotation = '<span class="annotation">// '+this.annotationObject[keyName]+'</span>';
}
html += this.getRow(indent, "<span class='array-brace'>[</span>"+clpsHtml+annotation, isPropertyContent);
for (let i = 0; i < obj.length; i++) {
html += this.processObject(obj[i], "", indent + 1, i < (obj.length - 1), true, false, showAnnotation);
}
clpsHtml = "</span>";
html += this.getRow(indent, clpsHtml + "<span class='array-brace'>]</span>" + comma);
}
} else if (type === 'object' && obj == null) {
html += this.formatLiteral("null", "", comma, indent, isArray, "null");
} else if (type === 'object') {
let numProps = 0;
for ( let prop in obj) {
numProps++;
}
if (numProps === 0) {
html += this.getRow(indent, "<span class='object-brace'>{ }</span>" + comma, isPropertyContent);
} else {
let clpsHtml = '<span><img class="option-img" src="webjars/mg-ui/img/expanded.png" onClick="Formatjson.expImgClicked(this);" /></span><span class="collapsible">';
let annotation = '';
if(showAnnotation && keyName && this.annotationObject[keyName]) {
annotation = '<span class="annotation">// '+this.annotationObject[keyName]+'</span>';
}
html += this.getRow(indent, "<span class='object-brace'>{</span>"+clpsHtml+annotation, isPropertyContent);
let j = 0;
for ( let prop in obj) {
let processStr = '<span class="property-name">"' + prop + '"</span>: ' + this.processObject(obj[prop], prop, indent + 1, ++j < numProps, false, true, showAnnotation);
html += this.getRow(indent + 1, processStr);
}
clpsHtml = "</span>";
html += this.getRow(indent, clpsHtml + "<span class='object-brace'>}</span>" + comma);
}
} else if (type === 'number') {
html += this.formatLiteral(obj, "", comma, indent, isArray, "number");
} else if (type === 'boolean') {
html += this.formatLiteral(obj, "", comma, indent, isArray, "boolean");
} else if (type === 'function') {
obj = this.formatFunction(indent, obj);
html += this.formatLiteral(obj, "", comma, indent, isArray, "function");
} else if (type === 'undefined') {
html += this.formatLiteral("undefined", "", comma, indent, isArray, "null");
} else {
html += this.formatLiteral(obj, "\"", comma, indent, isArray, "string");
}
return html;
},
expImgClicked: function(img){
let container = img.parentNode.nextSibling;
if(!container) return;
let disp = "none";
let src = "webjars/mg-ui/img/collapsed.png";
if(container.style.display === "none"){
disp = "inline";
src = "webjars/mg-ui/img/expanded.png";
}
container.style.display = disp;
img.src = src;
},
formatLiteral: function(literal, quote, comma, indent, isArray, style) {
if (typeof literal == 'string') {
literal = literal.split("<").join("&lt;").split(">").join("&gt;");
}
let str = "<span class='" + style + "'>" + quote + literal + quote + comma + "</span>";
if (isArray) {
str = this.getRow(indent, str);
}
return str;
},
formatFunction: function(indent, obj) {
let tabs = "";
for (let i = 0; i < indent; i++) {
tabs += this.tabStr;
}
let funcStrArray = obj.toString().split("\n");
let str = "";
for (let i = 0; i < funcStrArray.length; i++) {
str += ((i === 0) ? "" : tabs) + funcStrArray[i] + "\n";
}
return str;
},
getRow: function(indent, data, isPropertyContent) {
let tabs = "";
for (let i = 0; i < indent && !isPropertyContent; i++) {
tabs += this.tabStr;
}
if (data != null && data.length > 0 && data.charAt(data.length - 1) !== "\n") {
data = data + "\n";
}
return tabs + data;
}
}

View File

@@ -6,8 +6,6 @@ import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
import routes from './routes'
import store from './store/index'
import { ElConfigProvider, ElCascader, ElCascaderPanel } from 'element-plus';
import 'element-plus/lib/theme-chalk/base.css'
const router = createRouter({
history: createWebHashHistory(),
@@ -18,9 +16,6 @@ app.config.productionTip = false;
app.use(Antd);
app.use(router);
app.use(store);
app.component(ElCascader.name, ElCascader);
app.component(ElCascaderPanel.name, ElCascaderPanel);
app.component(ElConfigProvider.name, ElConfigProvider);
app.mount('#app');
// 注册一个全局自定义指令

View File

@@ -105,7 +105,7 @@
let activePage = ref('urlParam');
// URL参数处理
const urlParamRef = ref();
let urlParamListProp = props.requestParamList.filter(item => item.in === 'query');
let urlParamListProp = props.requestParamList.filter(item => item.in === 'query' || item.in === 'path');
let urlParamList = ref([]);
// Header参数处理
const headerParamRef = ref();
@@ -190,9 +190,11 @@
message.error('请输入请求的目标URL地址');
return;
}
let formObjData = {};
const formData = new FormData();
let urlParamSelected = urlParamRef.value.getSelectedRowKeys();
let urlParamStr = urlParamList.value.filter(item => urlParamSelected.indexOf(item.key) >= 0 && item.name && item.value).map(item => {
formObjData[item.name] = item.value;
return item.name + '=' + encodeURIComponent(item.value);
}).join('&');
let headerParamSelected = headerParamRef.value.getSelectedRowKeys();
@@ -208,6 +210,7 @@
let formParamSelected = formParamRef.value.getSelectedRowKeys();
formParamArr = formParamList.value.filter(item => formParamSelected.indexOf(item.key) >= 0 && item.name && item.value).map(item => {
// todo 判断处理文件格式
formObjData[item.name] = item.value;
return {code: item.name, value: item.value};
});
}
@@ -216,6 +219,7 @@
let formEncodeParamSelected = formEncodeParamRef.value.getSelectedRowKeys();
formEncodeParamArr = formEncodeParamList.value.filter(item => formEncodeParamSelected.indexOf(item.key) >= 0 && item.name && item.value).map(item => {
// todo 判断处理文件格式
formObjData[item.name] = item.value;
return {code: item.name, value: item.value};
});
}
@@ -227,6 +231,10 @@
// formData.append('files[]', file);
// });
let url = urlParamStr ? (docUrl.value + '?' + urlParamStr) : docUrl.value;
// 替换path参数
Object.keys(formObjData).forEach((key) => {
url = url.replace("{" + key + "}", formObjData[key]);
});
// 下载请求
if (isDownloadRequest) {
downloadFormParam.value.param = {

View File

@@ -13,22 +13,6 @@ export default defineConfig({
base: '',
plugins: [
vue(),
styleImport({
libs: [
// 使用element-plus的一些组件
{
libraryName: 'element-plus',
esModule: true,
ensureStyleFile: true,
resolveStyle: (name) => {
return `element-plus/lib/theme-chalk/${name}.css`;
},
resolveComponent: (name) => {
return `element-plus/lib/${name}`;
},
}
]
})
],
build: {
emptyOutDir: true,