diff --git a/sop-admin/sop-admin-server/src/main/resources/public/index.html b/sop-admin/sop-admin-server/src/main/resources/public/index.html index 84ed0d3f..f7ad0df1 100644 --- a/sop-admin/sop-admin-server/src/main/resources/public/index.html +++ b/sop-admin/sop-admin-server/src/main/resources/public/index.html @@ -1 +1 @@ -SOP Admin
\ No newline at end of file +SOP Admin
\ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-0d28f1a9.29df36bf.css b/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-0d28f1a9.29df36bf.css deleted file mode 100644 index cb321ce4..00000000 --- a/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-0d28f1a9.29df36bf.css +++ /dev/null @@ -1 +0,0 @@ -.limit-tip[data-v-bf1348ea]{cursor:pointer;margin-left:10px} \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-ffbffe42.40ae0e8d.css b/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-ffbffe42.40ae0e8d.css new file mode 100644 index 00000000..ff8e71f9 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-ffbffe42.40ae0e8d.css @@ -0,0 +1 @@ +.limit-tip[data-v-b54eb5a0]{cursor:pointer;margin-left:10px} \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/app.f1f9e7ae.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/app.fb4ef834.js similarity index 99% rename from sop-admin/sop-admin-server/src/main/resources/public/static/js/app.f1f9e7ae.js rename to sop-admin/sop-admin-server/src/main/resources/public/static/js/app.fb4ef834.js index 6afec6e2..fe8ce395 100644 --- a/sop-admin/sop-admin-server/src/main/resources/public/static/js/app.f1f9e7ae.js +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/app.fb4ef834.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app"],{0:function(e,t,n){e.exports=n("56d7")},"0cb8":function(e,t,n){},"186a":function(e,t,n){"use strict";var a=n("dc52"),i=n.n(a);i.a},"18f0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"1f59":function(e,t,n){},2536:function(e,t,n){},2635:function(e,t,n){},"2a3d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"30c3":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-example",use:"icon-example-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"34c8":function(e,t,n){"use strict";var a=n("5332"),i=n.n(a);i.a},"405a":function(e,t,n){"use strict";var a=n("1f59"),i=n.n(a);i.a},"47f1":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-table",use:"icon-table-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"4df5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});r.a.add(s);t["default"]=s},"50be":function(e,t,n){"use strict";var a=n("2536"),i=n.n(a);i.a},"51ff":function(e,t,n){var a={"./dashboard.svg":"f782","./example.svg":"30c3","./eye-open.svg":"d7ec","./eye.svg":"4df5","./form.svg":"eb1b","./link.svg":"18f0","./nested.svg":"dcf8","./password.svg":"2a3d","./table.svg":"47f1","./tree.svg":"93cd","./user.svg":"b3b5"};function i(e){var t=o(e);return n(t)}function o(e){var t=a[e];if(!(t+1)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="51ff"},5332:function(e,t,n){},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var a=n("2b0e"),i=(n("f5df"),n("5c96")),o=n.n(i),r=(n("0fae"),n("f0d9")),s=n.n(r),c=(n("b20f"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("router-view")],1)}),u=[],l={name:"App"},d=l,h=n("2877"),m=Object(h["a"])(d,c,u,!1,null,null,null),f=m.exports,p=n("2f62"),v=(n("7f7f"),{sidebar:function(e){return e.app.sidebar},device:function(e){return e.app.device},token:function(e){return e.user.token},avatar:function(e){return e.user.avatar},name:function(e){return e.user.name}}),b=v,g=n("a78e"),w=n.n(g),x={sidebar:{opened:!w.a.get("sidebarStatus")||!!+w.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop"},y={TOGGLE_SIDEBAR:function(e){e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1,e.sidebar.opened?w.a.set("sidebarStatus",1):w.a.set("sidebarStatus",0)},CLOSE_SIDEBAR:function(e,t){w.a.set("sidebarStatus",0),e.sidebar.opened=!1,e.sidebar.withoutAnimation=t},TOGGLE_DEVICE:function(e,t){e.device=t}},_={toggleSideBar:function(e){var t=e.commit;t("TOGGLE_SIDEBAR")},closeSideBar:function(e,t){var n=e.commit,a=t.withoutAnimation;n("CLOSE_SIDEBAR",a)},toggleDevice:function(e,t){var n=e.commit;n("TOGGLE_DEVICE",t)}},C={namespaced:!0,state:x,mutations:y,actions:_},k=n("83d6"),O=n.n(k),S=O.a.showSettings,z=O.a.fixedHeader,B=O.a.sidebarLogo,H={showSettings:S,fixedHeader:z,sidebarLogo:B},M={CHANGE_SETTING:function(e,t){var n=t.key,a=t.value;e.hasOwnProperty(n)&&(e[n]=a)}},T={changeSetting:function(e,t){var n=e.commit;n("CHANGE_SETTING",t)}},E={namespaced:!0,state:H,mutations:M,actions:T},L=n("bc3a"),$=n.n(L),V=n("5f87"),A=$.a.create({baseURL:"/api",withCredentials:!0,timeout:5e3});A.interceptors.request.use(function(e){return bt.getters.token&&(e.headers["X-Token"]=Object(V["a"])()),e},function(e){return console.log(e),Promise.reject(e)}),A.interceptors.response.use(function(e){var t=e.data;return 2e4!==t.code?(Object(i["Message"])({message:t.message||"error",type:"error",duration:5e3}),50008!==t.code&&50012!==t.code&&50014!==t.code||i["MessageBox"].confirm("You have been logged out, you can cancel to stay on this page, or log in again","Confirm logout",{confirmButtonText:"Re-Login",cancelButtonText:"Cancel",type:"warning"}).then(function(){bt.dispatch("user/resetToken").then(function(){location.reload()})}),Promise.reject(t.message||"error")):t},function(e){return console.log("err"+e),Object(i["Message"])({message:e.message,type:"error",duration:5e3}),Promise.reject(e)});var j=A;function P(e){return j({url:"/user/login",method:"post",data:e})}function I(e){return j({url:"/user/info",method:"get",params:{token:e}})}function N(){return j({url:"/user/logout",method:"post"})}var D=n("8c4f"),q=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-wrapper",class:e.classObj},["mobile"===e.device&&e.sidebar.opened?n("div",{staticClass:"drawer-bg",on:{click:e.handleClickOutside}}):e._e(),e._v(" "),n("sidebar",{staticClass:"sidebar-container"}),e._v(" "),n("div",{staticClass:"main-container"},[n("div",{class:{"fixed-header":e.fixedHeader}},[n("navbar")],1),e._v(" "),n("app-main")],1)],1)},R=[],G=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"navbar"},[n("hamburger",{staticClass:"hamburger-container",attrs:{"is-active":e.sidebar.opened},on:{toggleClick:e.toggleSideBar}}),e._v(" "),n("breadcrumb",{staticClass:"breadcrumb-container"}),e._v(" "),n("div",{staticClass:"right-menu"},[n("el-button",{staticStyle:{"margin-right":"10px"},attrs:{type:"text"},on:{click:e.doLogout}},[e._v("退出")])],1)],1)},F=[],U=n("cebc"),K=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-breadcrumb",{staticClass:"app-breadcrumb",attrs:{separator:"/"}},[n("transition-group",{attrs:{name:"breadcrumb"}},e._l(e.levelList,function(t,a){return n("el-breadcrumb-item",{key:t.path},["noRedirect"===t.redirect||a==e.levelList.length-1?n("span",{staticClass:"no-redirect"},[e._v(e._s(t.meta.title))]):n("a",{on:{click:function(n){return n.preventDefault(),e.handleLink(t)}}},[e._v(e._s(t.meta.title))])])}),1)],1)},W=[],J=n("bd11"),X=n.n(J),Y={data:function(){return{levelList:null}},watch:{$route:function(){this.getBreadcrumb()}},created:function(){this.getBreadcrumb()},methods:{getBreadcrumb:function(){var e=this.$route.matched.filter(function(e){return e.meta&&e.meta.title}),t=e[0];this.isDashboard(t)||(e=[{path:"/dashboard",meta:{title:"Dashboard"}}].concat(e)),this.levelList=e.filter(function(e){return e.meta&&e.meta.title&&!1!==e.meta.breadcrumb})},isDashboard:function(e){var t=e&&e.name;return!!t&&t.trim().toLocaleLowerCase()==="Dashboard".toLocaleLowerCase()},pathCompile:function(e){var t=this.$route.params,n=X.a.compile(e);return n(t)},handleLink:function(e){var t=e.redirect,n=e.path;t?this.$router.push(t):this.$router.push(this.pathCompile(n))}}},Q=Y,Z=(n("34c8"),Object(h["a"])(Q,K,W,!1,null,"62cc9144",null)),ee=Z.exports,te=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{padding:"0 15px"},on:{click:e.toggleClick}},[n("svg",{staticClass:"hamburger",class:{"is-active":e.isActive},attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"}},[n("path",{attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"}})])])},ne=[],ae={name:"Hamburger",props:{isActive:{type:Boolean,default:!1}},methods:{toggleClick:function(){this.$emit("toggleClick")}}},ie=ae,oe=(n("186a"),Object(h["a"])(ie,te,ne,!1,null,"49e15297",null)),re=oe.exports,se={components:{Breadcrumb:ee,Hamburger:re},computed:Object(U["a"])({},Object(p["b"])(["sidebar","avatar"])),methods:{toggleSideBar:function(){this.$store.dispatch("app/toggleSideBar")},doLogout:function(){this.logout()}}},ce=se,ue=(n("405a"),Object(h["a"])(ce,G,F,!1,null,"1eff5c58",null)),le=ue.exports,de=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{"has-logo":e.showLogo}},[e.showLogo?n("logo",{attrs:{collapse:e.isCollapse}}):e._e(),e._v(" "),n("el-scrollbar",{attrs:{"wrap-class":"scrollbar-wrapper"}},[n("el-menu",{attrs:{"default-active":e.activeMenu,collapse:e.isCollapse,"background-color":e.variables.menuBg,"text-color":e.variables.menuText,"unique-opened":!1,"active-text-color":e.variables.menuActiveText,"collapse-transition":!1,mode:"vertical"}},e._l(e.routes,function(e){return n("sidebar-item",{key:e.path,attrs:{item:e,"base-path":e.path}})}),1)],1)],1)},he=[],me=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sidebar-logo-container",class:{collapse:e.collapse}},[n("transition",{attrs:{name:"sidebarLogoFade"}},[e.collapse?n("router-link",{key:"collapse",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])]):n("router-link",{key:"expand",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):e._e(),e._v(" "),n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])])],1)],1)},fe=[],pe={name:"SidebarLogo",props:{collapse:{type:Boolean,required:!0}},data:function(){return{title:"SOP Admin",logo:"https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png"}}},ve=pe,be=(n("7c27"),Object(h["a"])(ve,me,fe,!1,null,"b905289c",null)),ge=be.exports,we=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.item.hidden?e._e():n("div",{staticClass:"menu-wrapper"},[!e.hasOneShowingChild(e.item.children,e.item)||e.onlyOneChild.children&&!e.onlyOneChild.noShowingChildren||e.item.alwaysShow?n("el-submenu",{ref:"subMenu",attrs:{index:e.resolvePath(e.item.path),"popper-append-to-body":""}},[n("template",{slot:"title"},[e.item.meta?n("item",{attrs:{icon:e.item.meta&&e.item.meta.icon,title:e.item.meta.title}}):e._e()],1),e._v(" "),e._l(e.item.children,function(t){return n("sidebar-item",{key:t.path,staticClass:"nest-menu",attrs:{"is-nest":!0,item:t,"base-path":e.resolvePath(t.path)}})})],2):[e.onlyOneChild.meta?n("app-link",{attrs:{to:e.resolvePath(e.onlyOneChild.path)}},[n("el-menu-item",{class:{"submenu-title-noDropdown":!e.isNest},attrs:{index:e.resolvePath(e.onlyOneChild.path)}},[n("item",{attrs:{icon:e.onlyOneChild.meta.icon||e.item.meta&&e.item.meta.icon,title:e.onlyOneChild.meta.title}})],1)],1):e._e()]],2)},xe=[],ye=n("df7c"),_e=n.n(ye);function Ce(e){return/^(https?:|mailto:|tel:)/.test(e)}var ke,Oe,Se={name:"MenuItem",functional:!0,props:{icon:{type:String,default:""},title:{type:String,default:""}},render:function(e,t){var n=t.props,a=n.icon,i=n.title,o=[];return a&&o.push(e("svg-icon",{attrs:{"icon-class":a}})),i&&o.push(e("span",{slot:"title"},[i])),o}},ze=Se,Be=Object(h["a"])(ze,ke,Oe,!1,null,null,null),He=Be.exports,Me=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("component",e._b({},"component",e.linkProps(e.to),!1),[e._t("default")],2)},Te=[],Ee={props:{to:{type:String,required:!0}},methods:{linkProps:function(e){return Ce(e)?{is:"a",href:e,target:"_blank",rel:"noopener"}:{is:"router-link",to:e}}}},Le=Ee,$e=Object(h["a"])(Le,Me,Te,!1,null,null,null),Ve=$e.exports,Ae={computed:{device:function(){return this.$store.state.app.device}},mounted:function(){this.fixBugIniOS()},methods:{fixBugIniOS:function(){var e=this,t=this.$refs.subMenu;if(t){var n=t.handleMouseleave;t.handleMouseleave=function(t){"mobile"!==e.device&&n(t)}}}}},je={name:"SidebarItem",components:{Item:He,AppLink:Ve},mixins:[Ae],props:{item:{type:Object,required:!0},isNest:{type:Boolean,default:!1},basePath:{type:String,default:""}},data:function(){return this.onlyOneChild=null,{}},methods:{hasOneShowingChild:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,a=t.filter(function(t){return!t.hidden&&(e.onlyOneChild=t,!0)});return 1===a.length||0===a.length&&(this.onlyOneChild=Object(U["a"])({},n,{path:"",noShowingChildren:!0}),!0)},resolvePath:function(e){return Ce(e)?e:Ce(this.basePath)?this.basePath:_e.a.resolve(this.basePath,e)}}},Pe=je,Ie=Object(h["a"])(Pe,we,xe,!1,null,null,null),Ne=Ie.exports,De=n("cf1e"),qe=n.n(De),Re={components:{SidebarItem:Ne,Logo:ge},computed:Object(U["a"])({},Object(p["b"])(["sidebar"]),{routes:function(){return this.$router.options.routes},activeMenu:function(){var e=this.$route,t=e.meta,n=e.path;return t.activeMenu?t.activeMenu:n},showLogo:function(){return this.$store.state.settings.sidebarLogo},variables:function(){return qe.a},isCollapse:function(){return!this.sidebar.opened}})},Ge=Re,Fe=Object(h["a"])(Ge,de,he,!1,null,null,null),Ue=Fe.exports,Ke=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"app-main"},[n("transition",{attrs:{name:"fade-transform",mode:"out-in"}},[n("router-view",{key:e.key})],1)],1)},We=[],Je={name:"AppMain",computed:{key:function(){return this.$route.fullPath}}},Xe=Je,Ye=(n("50be"),Object(h["a"])(Xe,Ke,We,!1,null,"43c24f68",null)),Qe=Ye.exports,Ze=document,et=Ze.body,tt=992,nt={watch:{$route:function(e){"mobile"===this.device&&this.sidebar.opened&&bt.dispatch("app/closeSideBar",{withoutAnimation:!1})}},beforeMount:function(){window.addEventListener("resize",this.$_resizeHandler)},beforeDestroy:function(){window.removeEventListener("resize",this.$_resizeHandler)},mounted:function(){var e=this.$_isMobile();e&&(bt.dispatch("app/toggleDevice","mobile"),bt.dispatch("app/closeSideBar",{withoutAnimation:!0}))},methods:{$_isMobile:function(){var e=et.getBoundingClientRect();return e.width-1'});r.a.add(s);t["default"]=s},"9f2b":function(e,t,n){"use strict";var a=n("5bb9"),i=n.n(a);i.a},b20f:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409EFF",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},b3b5:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-user",use:"icon-user-usage",viewBox:"0 0 130 130",content:''});r.a.add(s);t["default"]=s},cf1e:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409EFF",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},d7ec:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-eye-open",use:"icon-eye-open-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(s);t["default"]=s},dc52:function(e,t,n){},dcf8:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-nested",use:"icon-nested-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},eb1b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},f782:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-dashboard",use:"icon-dashboard-usage",viewBox:"0 0 128 100",content:''});r.a.add(s);t["default"]=s}},[[0,"runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app"],{0:function(e,t,n){e.exports=n("56d7")},"0cb8":function(e,t,n){},"186a":function(e,t,n){"use strict";var a=n("dc52"),i=n.n(a);i.a},"18f0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"1f59":function(e,t,n){},2536:function(e,t,n){},2635:function(e,t,n){},"2a3d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"30c3":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-example",use:"icon-example-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"34c8":function(e,t,n){"use strict";var a=n("5332"),i=n.n(a);i.a},"405a":function(e,t,n){"use strict";var a=n("1f59"),i=n.n(a);i.a},"47f1":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-table",use:"icon-table-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"4df5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});r.a.add(s);t["default"]=s},"50be":function(e,t,n){"use strict";var a=n("2536"),i=n.n(a);i.a},"51ff":function(e,t,n){var a={"./dashboard.svg":"f782","./example.svg":"30c3","./eye-open.svg":"d7ec","./eye.svg":"4df5","./form.svg":"eb1b","./link.svg":"18f0","./nested.svg":"dcf8","./password.svg":"2a3d","./table.svg":"47f1","./tree.svg":"93cd","./user.svg":"b3b5"};function i(e){var t=o(e);return n(t)}function o(e){var t=a[e];if(!(t+1)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="51ff"},5332:function(e,t,n){},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var a=n("2b0e"),i=(n("f5df"),n("5c96")),o=n.n(i),r=(n("0fae"),n("f0d9")),s=n.n(r),c=(n("b20f"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("router-view")],1)}),u=[],l={name:"App"},d=l,h=n("2877"),m=Object(h["a"])(d,c,u,!1,null,null,null),f=m.exports,p=n("2f62"),v=(n("7f7f"),{sidebar:function(e){return e.app.sidebar},device:function(e){return e.app.device},token:function(e){return e.user.token},avatar:function(e){return e.user.avatar},name:function(e){return e.user.name}}),b=v,g=n("a78e"),w=n.n(g),x={sidebar:{opened:!w.a.get("sidebarStatus")||!!+w.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop"},y={TOGGLE_SIDEBAR:function(e){e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1,e.sidebar.opened?w.a.set("sidebarStatus",1):w.a.set("sidebarStatus",0)},CLOSE_SIDEBAR:function(e,t){w.a.set("sidebarStatus",0),e.sidebar.opened=!1,e.sidebar.withoutAnimation=t},TOGGLE_DEVICE:function(e,t){e.device=t}},_={toggleSideBar:function(e){var t=e.commit;t("TOGGLE_SIDEBAR")},closeSideBar:function(e,t){var n=e.commit,a=t.withoutAnimation;n("CLOSE_SIDEBAR",a)},toggleDevice:function(e,t){var n=e.commit;n("TOGGLE_DEVICE",t)}},C={namespaced:!0,state:x,mutations:y,actions:_},k=n("83d6"),O=n.n(k),S=O.a.showSettings,z=O.a.fixedHeader,B=O.a.sidebarLogo,H={showSettings:S,fixedHeader:z,sidebarLogo:B},M={CHANGE_SETTING:function(e,t){var n=t.key,a=t.value;e.hasOwnProperty(n)&&(e[n]=a)}},T={changeSetting:function(e,t){var n=e.commit;n("CHANGE_SETTING",t)}},E={namespaced:!0,state:H,mutations:M,actions:T},L=n("bc3a"),$=n.n(L),V=n("5f87"),A=$.a.create({baseURL:"/api",withCredentials:!0,timeout:5e3});A.interceptors.request.use(function(e){return bt.getters.token&&(e.headers["X-Token"]=Object(V["a"])()),e},function(e){return console.log(e),Promise.reject(e)}),A.interceptors.response.use(function(e){var t=e.data;return 2e4!==t.code?(Object(i["Message"])({message:t.message||"error",type:"error",duration:5e3}),50008!==t.code&&50012!==t.code&&50014!==t.code||i["MessageBox"].confirm("You have been logged out, you can cancel to stay on this page, or log in again","Confirm logout",{confirmButtonText:"Re-Login",cancelButtonText:"Cancel",type:"warning"}).then(function(){bt.dispatch("user/resetToken").then(function(){location.reload()})}),Promise.reject(t.message||"error")):t},function(e){return console.log("err"+e),Object(i["Message"])({message:e.message,type:"error",duration:5e3}),Promise.reject(e)});var j=A;function P(e){return j({url:"/user/login",method:"post",data:e})}function I(e){return j({url:"/user/info",method:"get",params:{token:e}})}function N(){return j({url:"/user/logout",method:"post"})}var D=n("8c4f"),q=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-wrapper",class:e.classObj},["mobile"===e.device&&e.sidebar.opened?n("div",{staticClass:"drawer-bg",on:{click:e.handleClickOutside}}):e._e(),e._v(" "),n("sidebar",{staticClass:"sidebar-container"}),e._v(" "),n("div",{staticClass:"main-container"},[n("div",{class:{"fixed-header":e.fixedHeader}},[n("navbar")],1),e._v(" "),n("app-main")],1)],1)},R=[],G=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"navbar"},[n("hamburger",{staticClass:"hamburger-container",attrs:{"is-active":e.sidebar.opened},on:{toggleClick:e.toggleSideBar}}),e._v(" "),n("breadcrumb",{staticClass:"breadcrumb-container"}),e._v(" "),n("div",{staticClass:"right-menu"},[n("el-button",{staticStyle:{"margin-right":"10px"},attrs:{type:"text"},on:{click:e.doLogout}},[e._v("退出")])],1)],1)},F=[],U=n("cebc"),K=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-breadcrumb",{staticClass:"app-breadcrumb",attrs:{separator:"/"}},[n("transition-group",{attrs:{name:"breadcrumb"}},e._l(e.levelList,function(t,a){return n("el-breadcrumb-item",{key:t.path},["noRedirect"===t.redirect||a==e.levelList.length-1?n("span",{staticClass:"no-redirect"},[e._v(e._s(t.meta.title))]):n("a",{on:{click:function(n){return n.preventDefault(),e.handleLink(t)}}},[e._v(e._s(t.meta.title))])])}),1)],1)},W=[],J=n("bd11"),X=n.n(J),Y={data:function(){return{levelList:null}},watch:{$route:function(){this.getBreadcrumb()}},created:function(){this.getBreadcrumb()},methods:{getBreadcrumb:function(){var e=this.$route.matched.filter(function(e){return e.meta&&e.meta.title}),t=e[0];this.isDashboard(t)||(e=[{path:"/dashboard",meta:{title:"Dashboard"}}].concat(e)),this.levelList=e.filter(function(e){return e.meta&&e.meta.title&&!1!==e.meta.breadcrumb})},isDashboard:function(e){var t=e&&e.name;return!!t&&t.trim().toLocaleLowerCase()==="Dashboard".toLocaleLowerCase()},pathCompile:function(e){var t=this.$route.params,n=X.a.compile(e);return n(t)},handleLink:function(e){var t=e.redirect,n=e.path;t?this.$router.push(t):this.$router.push(this.pathCompile(n))}}},Q=Y,Z=(n("34c8"),Object(h["a"])(Q,K,W,!1,null,"62cc9144",null)),ee=Z.exports,te=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{padding:"0 15px"},on:{click:e.toggleClick}},[n("svg",{staticClass:"hamburger",class:{"is-active":e.isActive},attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"}},[n("path",{attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"}})])])},ne=[],ae={name:"Hamburger",props:{isActive:{type:Boolean,default:!1}},methods:{toggleClick:function(){this.$emit("toggleClick")}}},ie=ae,oe=(n("186a"),Object(h["a"])(ie,te,ne,!1,null,"49e15297",null)),re=oe.exports,se={components:{Breadcrumb:ee,Hamburger:re},computed:Object(U["a"])({},Object(p["b"])(["sidebar","avatar"])),methods:{toggleSideBar:function(){this.$store.dispatch("app/toggleSideBar")},doLogout:function(){this.logout()}}},ce=se,ue=(n("405a"),Object(h["a"])(ce,G,F,!1,null,"1eff5c58",null)),le=ue.exports,de=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{"has-logo":e.showLogo}},[e.showLogo?n("logo",{attrs:{collapse:e.isCollapse}}):e._e(),e._v(" "),n("el-scrollbar",{attrs:{"wrap-class":"scrollbar-wrapper"}},[n("el-menu",{attrs:{"default-active":e.activeMenu,collapse:e.isCollapse,"background-color":e.variables.menuBg,"text-color":e.variables.menuText,"unique-opened":!1,"active-text-color":e.variables.menuActiveText,"collapse-transition":!1,mode:"vertical"}},e._l(e.routes,function(e){return n("sidebar-item",{key:e.path,attrs:{item:e,"base-path":e.path}})}),1)],1)],1)},he=[],me=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sidebar-logo-container",class:{collapse:e.collapse}},[n("transition",{attrs:{name:"sidebarLogoFade"}},[e.collapse?n("router-link",{key:"collapse",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])]):n("router-link",{key:"expand",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):e._e(),e._v(" "),n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])])],1)],1)},fe=[],pe={name:"SidebarLogo",props:{collapse:{type:Boolean,required:!0}},data:function(){return{title:"SOP Admin",logo:"https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png"}}},ve=pe,be=(n("7c27"),Object(h["a"])(ve,me,fe,!1,null,"b905289c",null)),ge=be.exports,we=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.item.hidden?e._e():n("div",{staticClass:"menu-wrapper"},[!e.hasOneShowingChild(e.item.children,e.item)||e.onlyOneChild.children&&!e.onlyOneChild.noShowingChildren||e.item.alwaysShow?n("el-submenu",{ref:"subMenu",attrs:{index:e.resolvePath(e.item.path),"popper-append-to-body":""}},[n("template",{slot:"title"},[e.item.meta?n("item",{attrs:{icon:e.item.meta&&e.item.meta.icon,title:e.item.meta.title}}):e._e()],1),e._v(" "),e._l(e.item.children,function(t){return n("sidebar-item",{key:t.path,staticClass:"nest-menu",attrs:{"is-nest":!0,item:t,"base-path":e.resolvePath(t.path)}})})],2):[e.onlyOneChild.meta?n("app-link",{attrs:{to:e.resolvePath(e.onlyOneChild.path)}},[n("el-menu-item",{class:{"submenu-title-noDropdown":!e.isNest},attrs:{index:e.resolvePath(e.onlyOneChild.path)}},[n("item",{attrs:{icon:e.onlyOneChild.meta.icon||e.item.meta&&e.item.meta.icon,title:e.onlyOneChild.meta.title}})],1)],1):e._e()]],2)},xe=[],ye=n("df7c"),_e=n.n(ye);function Ce(e){return/^(https?:|mailto:|tel:)/.test(e)}var ke,Oe,Se={name:"MenuItem",functional:!0,props:{icon:{type:String,default:""},title:{type:String,default:""}},render:function(e,t){var n=t.props,a=n.icon,i=n.title,o=[];return a&&o.push(e("svg-icon",{attrs:{"icon-class":a}})),i&&o.push(e("span",{slot:"title"},[i])),o}},ze=Se,Be=Object(h["a"])(ze,ke,Oe,!1,null,null,null),He=Be.exports,Me=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("component",e._b({},"component",e.linkProps(e.to),!1),[e._t("default")],2)},Te=[],Ee={props:{to:{type:String,required:!0}},methods:{linkProps:function(e){return Ce(e)?{is:"a",href:e,target:"_blank",rel:"noopener"}:{is:"router-link",to:e}}}},Le=Ee,$e=Object(h["a"])(Le,Me,Te,!1,null,null,null),Ve=$e.exports,Ae={computed:{device:function(){return this.$store.state.app.device}},mounted:function(){this.fixBugIniOS()},methods:{fixBugIniOS:function(){var e=this,t=this.$refs.subMenu;if(t){var n=t.handleMouseleave;t.handleMouseleave=function(t){"mobile"!==e.device&&n(t)}}}}},je={name:"SidebarItem",components:{Item:He,AppLink:Ve},mixins:[Ae],props:{item:{type:Object,required:!0},isNest:{type:Boolean,default:!1},basePath:{type:String,default:""}},data:function(){return this.onlyOneChild=null,{}},methods:{hasOneShowingChild:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,a=t.filter(function(t){return!t.hidden&&(e.onlyOneChild=t,!0)});return 1===a.length||0===a.length&&(this.onlyOneChild=Object(U["a"])({},n,{path:"",noShowingChildren:!0}),!0)},resolvePath:function(e){return Ce(e)?e:Ce(this.basePath)?this.basePath:_e.a.resolve(this.basePath,e)}}},Pe=je,Ie=Object(h["a"])(Pe,we,xe,!1,null,null,null),Ne=Ie.exports,De=n("cf1e"),qe=n.n(De),Re={components:{SidebarItem:Ne,Logo:ge},computed:Object(U["a"])({},Object(p["b"])(["sidebar"]),{routes:function(){return this.$router.options.routes},activeMenu:function(){var e=this.$route,t=e.meta,n=e.path;return t.activeMenu?t.activeMenu:n},showLogo:function(){return this.$store.state.settings.sidebarLogo},variables:function(){return qe.a},isCollapse:function(){return!this.sidebar.opened}})},Ge=Re,Fe=Object(h["a"])(Ge,de,he,!1,null,null,null),Ue=Fe.exports,Ke=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"app-main"},[n("transition",{attrs:{name:"fade-transform",mode:"out-in"}},[n("router-view",{key:e.key})],1)],1)},We=[],Je={name:"AppMain",computed:{key:function(){return this.$route.fullPath}}},Xe=Je,Ye=(n("50be"),Object(h["a"])(Xe,Ke,We,!1,null,"43c24f68",null)),Qe=Ye.exports,Ze=document,et=Ze.body,tt=992,nt={watch:{$route:function(e){"mobile"===this.device&&this.sidebar.opened&&bt.dispatch("app/closeSideBar",{withoutAnimation:!1})}},beforeMount:function(){window.addEventListener("resize",this.$_resizeHandler)},beforeDestroy:function(){window.removeEventListener("resize",this.$_resizeHandler)},mounted:function(){var e=this.$_isMobile();e&&(bt.dispatch("app/toggleDevice","mobile"),bt.dispatch("app/closeSideBar",{withoutAnimation:!0}))},methods:{$_isMobile:function(){var e=et.getBoundingClientRect();return e.width-1'});r.a.add(s);t["default"]=s},"9f2b":function(e,t,n){"use strict";var a=n("5bb9"),i=n.n(a);i.a},b20f:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409EFF",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},b3b5:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-user",use:"icon-user-usage",viewBox:"0 0 130 130",content:''});r.a.add(s);t["default"]=s},cf1e:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409EFF",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},d7ec:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-eye-open",use:"icon-eye-open-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(s);t["default"]=s},dc52:function(e,t,n){},dcf8:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-nested",use:"icon-nested-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},eb1b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},f782:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-dashboard",use:"icon-dashboard-usage",viewBox:"0 0 128 100",content:''});r.a.add(s);t["default"]=s}},[[0,"runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-0d28f1a9.6e07cb91.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-0d28f1a9.6e07cb91.js deleted file mode 100644 index 9bafd62d..00000000 --- a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-0d28f1a9.6e07cb91.js +++ /dev/null @@ -1 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0d28f1a9"],{"0a49":function(e,t,i){var a=i("9b43"),l=i("626a"),o=i("4bf8"),r=i("9def"),n=i("cd1c");e.exports=function(e,t){var i=1==e,s=2==e,m=3==e,c=4==e,p=6==e,u=5==e||p,d=t||n;return function(t,n,g){for(var f,y,h=o(t),D=l(h),v=a(n,g,3),b=r(D.length),k=0,x=i?d(t,b):s?d(t,0):void 0;b>k;k++)if((u||k in D)&&(f=D[k],y=v(f,k,h),e))if(i)x[k]=y;else if(y)switch(e){case 3:return!0;case 5:return f;case 6:return k;case 2:x.push(f)}else if(c)return!1;return p?-1:m||c?c:x}}},1169:function(e,t,i){var a=i("2d95");e.exports=Array.isArray||function(e){return"Array"==a(e)}},1510:function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("el-container",[i("el-aside",{staticStyle:{"min-height":"300px",width:"200px"}},[i("el-input",{staticStyle:{"margin-bottom":"20px"},attrs:{"prefix-icon":"el-icon-search",placeholder:"搜索服务...",size:"mini",clearable:""},model:{value:e.filterText,callback:function(t){e.filterText=t},expression:"filterText"}}),e._v(" "),i("el-tree",{ref:"tree2",staticClass:"filter-tree",attrs:{data:e.treeData,props:e.defaultProps,"filter-node-method":e.filterNode,"highlight-current":!0,"expand-on-click-node":!1,"empty-text":"无数据","node-key":"id","default-expand-all":""},on:{"node-click":e.onNodeClick},scopedSlots:e._u([{key:"default",fn:function(t){t.node;var a=t.data;return i("span",{staticClass:"custom-tree-node"},[a.label.length<15?i("span",[e._v(e._s(a.label))]):i("span",[i("el-tooltip",{staticClass:"item",attrs:{content:a.label,effect:"light",placement:"right"}},[i("span",[e._v(e._s(a.label.substring(0,15)+"..."))])])],1)])}}])})],1),e._v(" "),i("el-main",{staticStyle:{"padding-top":"0"}},[i("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.searchFormData,size:"mini"}},[i("el-form-item",{attrs:{label:"路由ID"}},[i("el-input",{attrs:{placeholder:"接口名,支持模糊查询",clearable:""},model:{value:e.searchFormData.routeId,callback:function(t){e.$set(e.searchFormData,"routeId",t)},expression:"searchFormData.routeId"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"AppKey"}},[i("el-input",{attrs:{placeholder:"AppKey,支持模糊查询",clearable:""},model:{value:e.searchFormData.appKey,callback:function(t){e.$set(e.searchFormData,"appKey",t)},expression:"searchFormData.appKey"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"IP"}},[i("el-input",{attrs:{placeholder:"ip,支持模糊查询",clearable:""},model:{value:e.searchFormData.limitIp,callback:function(t){e.$set(e.searchFormData,"limitIp",t)},expression:"searchFormData.limitIp"}})],1),e._v(" "),i("el-form-item",[i("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.onSearchTable}},[e._v("查询")])],1)],1),e._v(" "),i("el-button",{staticStyle:{"margin-bottom":"10px"},attrs:{type:"primary",size:"mini",icon:"el-icon-plus"},on:{click:e.onAdd}},[e._v("新增限流")]),e._v(" "),i("el-table",{attrs:{data:e.pageInfo.list,border:""}},[i("el-table-column",{attrs:{prop:"limitKey",label:"限流维度",width:"400"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("div",{domProps:{innerHTML:e._s(e.limitRender(t.row))}})]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"limitType",label:"限流策略",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===t.row.limitType?i("span",[e._v("漏桶策略")]):e._e(),e._v(" "),2===t.row.limitType?i("span",[e._v("令牌桶策略")]):e._e()]}}])},[i("template",{slot:"header"},[e._v("\n 限流策略 "),i("i",{staticClass:"el-icon-question",staticStyle:{cursor:"pointer"},on:{click:e.onLimitTypeTipClick}})])],2),e._v(" "),i("el-table-column",{attrs:{prop:"info",label:"限流信息",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",{domProps:{innerHTML:e._s(e.infoRender(t.row))}})]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"limitStatus",label:"状态",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===t.row.limitStatus?i("span",{staticStyle:{color:"#67C23A"}},[e._v("已开启")]):e._e(),e._v(" "),0===t.row.limitStatus?i("span",{staticStyle:{color:"#909399"}},[e._v("已关闭")]):e._e()]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"orderIndex",label:"排序",width:"80"}}),e._v(" "),i("el-table-column",{attrs:{prop:"remark",label:"备注",width:"150","show-overflow-tooltip":!0}}),e._v(" "),i("el-table-column",{attrs:{prop:"gmtCreate",label:"创建时间",width:"160"}}),e._v(" "),i("el-table-column",{attrs:{prop:"gmtModified",label:"修改时间",width:"160"}}),e._v(" "),i("el-table-column",{attrs:{label:"操作",fixed:"right",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(i){return e.onTableUpdate(t.row)}}},[e._v("修改")])]}}])})],1),e._v(" "),i("el-pagination",{staticStyle:{"margin-top":"5px"},attrs:{background:"","current-page":e.searchFormData.pageIndex,"page-size":e.searchFormData.pageSize,"page-sizes":[5,10,20,40],total:e.pageInfo.total,layout:"total, sizes, prev, pager, next"},on:{"size-change":e.onSizeChange,"current-change":e.onPageIndexChange}}),e._v(" "),i("el-dialog",{attrs:{title:e.dlgTitle,visible:e.limitDialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.limitDialogVisible=t},close:e.onLimitDialogClose}},[i("el-form",{ref:"limitDialogForm",attrs:{model:e.limitDialogFormData,rules:e.rulesLimit,"label-width":"150px",size:"mini"}},[i("el-form-item",{attrs:{label:"限流维度",prop:"typeKey"}},[i("el-checkbox-group",{model:{value:e.limitDialogFormData.typeKey,callback:function(t){e.$set(e.limitDialogFormData,"typeKey",t)},expression:"limitDialogFormData.typeKey"}},[i("el-checkbox",{attrs:{label:1,name:"typeKey"},on:{change:function(t){return e.onLimitKeyTypeChange(t,"routeId")}},model:{value:e.limitDialogFormData.typeKey[0],callback:function(t){e.$set(e.limitDialogFormData.typeKey,0,t)},expression:"limitDialogFormData.typeKey[0]"}},[e._v("路由ID")]),e._v(" "),i("el-checkbox",{attrs:{label:2,name:"typeKey"},on:{change:function(t){return e.onLimitKeyTypeChange(t,"appKey")}},model:{value:e.limitDialogFormData.typeKey[1],callback:function(t){e.$set(e.limitDialogFormData.typeKey,1,t)},expression:"limitDialogFormData.typeKey[1]"}},[e._v("AppKey")]),e._v(" "),i("el-checkbox",{attrs:{label:3,name:"typeKey"},on:{change:function(t){return e.onLimitKeyTypeChange(t,"limitIp")}},model:{value:e.limitDialogFormData.typeKey[2],callback:function(t){e.$set(e.limitDialogFormData.typeKey,2,t)},expression:"limitDialogFormData.typeKey[2]"}},[e._v("IP")])],1)],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.checkTypeKey(1),expression:"checkTypeKey(1)"}],attrs:{prop:"routeId",label:"路由ID",rules:e.checkTypeKey(1)?e.rulesLimit.routeId:[]}},[i("el-select",{staticStyle:{width:"300px"},attrs:{filterable:"",placeholder:"可筛选"},model:{value:e.limitDialogFormData.routeId,callback:function(t){e.$set(e.limitDialogFormData,"routeId",t)},expression:"limitDialogFormData.routeId"}},e._l(e.routeList,function(t){return i("el-option",{key:t.id,attrs:{label:t.id,value:t.id}},[i("span",{staticStyle:{float:"left"}},[e._v(e._s(t.name))]),e._v(" "),i("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"13px"}},[e._v(e._s(t.version))])])}),1)],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.checkTypeKey(2),expression:"checkTypeKey(2)"}],attrs:{prop:"appKey",label:"AppKey",rules:e.checkTypeKey(2)?e.rulesLimit.appKey:[]}},[i("el-input",{attrs:{placeholder:"需要限流的appKey"},model:{value:e.limitDialogFormData.appKey,callback:function(t){e.$set(e.limitDialogFormData,"appKey",t)},expression:"limitDialogFormData.appKey"}})],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.checkTypeKey(3),expression:"checkTypeKey(3)"}],attrs:{label:"限流IP",prop:"limitIp",rules:e.checkTypeKey(3)?e.rulesLimit.ip:[]}},[i("el-input",{attrs:{type:"textarea",rows:2,placeholder:"多个用英文逗号隔开"},model:{value:e.limitDialogFormData.limitIp,callback:function(t){e.$set(e.limitDialogFormData,"limitIp",t)},expression:"limitDialogFormData.limitIp"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"限流策略"}},[i("el-radio-group",{model:{value:e.limitDialogFormData.limitType,callback:function(t){e.$set(e.limitDialogFormData,"limitType",t)},expression:"limitDialogFormData.limitType"}},[i("el-radio",{attrs:{label:1}},[e._v("漏桶策略")]),e._v(" "),i("el-radio",{attrs:{label:2}},[e._v("令牌桶策略")])],1),e._v(" "),i("i",{staticClass:"el-icon-question limit-tip",on:{click:e.onLimitTypeTipClick}})],1),e._v(" "),i("el-form-item",{attrs:{label:"开启状态"}},[i("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#ff4949","active-value":1,"inactive-value":0},model:{value:e.limitDialogFormData.limitStatus,callback:function(t){e.$set(e.limitDialogFormData,"limitStatus",t)},expression:"limitDialogFormData.limitStatus"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"排序",prop:"orderIndex"}},[i("el-input-number",{attrs:{"controls-position":"right",min:0},model:{value:e.limitDialogFormData.orderIndex,callback:function(t){e.$set(e.limitDialogFormData,"orderIndex",t)},expression:"limitDialogFormData.orderIndex"}}),e._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"值小优先执行",placement:"top"}},[i("i",{staticClass:"el-icon-question limit-tip"})])],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.isLeakyType(),expression:"isLeakyType()"}],attrs:{label:"每秒可处理请求数",prop:"execCountPerSecond",rules:e.isLeakyType()?e.rulesLimit.execCountPerSecond:[]}},[i("el-input-number",{attrs:{"controls-position":"right",min:1},model:{value:e.limitDialogFormData.execCountPerSecond,callback:function(t){e.$set(e.limitDialogFormData,"execCountPerSecond",t)},expression:"limitDialogFormData.execCountPerSecond"}})],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.isLeakyType(),expression:"isLeakyType()"}],attrs:{label:"错误码",prop:"limitCode",rules:e.isLeakyType()?e.rulesLimit.limitCode:[]}},[i("el-input",{model:{value:e.limitDialogFormData.limitCode,callback:function(t){e.$set(e.limitDialogFormData,"limitCode",t)},expression:"limitDialogFormData.limitCode"}})],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.isLeakyType(),expression:"isLeakyType()"}],attrs:{label:"错误信息",prop:"limitMsg",rules:e.isLeakyType()?e.rulesLimit.limitMsg:[]}},[i("el-input",{model:{value:e.limitDialogFormData.limitMsg,callback:function(t){e.$set(e.limitDialogFormData,"limitMsg",t)},expression:"limitDialogFormData.limitMsg"}})],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.isTokenType(),expression:"isTokenType()"}],attrs:{label:"令牌桶容量",prop:"tokenBucketCount",rules:e.isTokenType()?e.rulesLimit.tokenBucketCount:[]}},[i("el-input-number",{attrs:{"controls-position":"right",min:1},model:{value:e.limitDialogFormData.tokenBucketCount,callback:function(t){e.$set(e.limitDialogFormData,"tokenBucketCount",t)},expression:"limitDialogFormData.tokenBucketCount"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"备注",prop:"remark"}},[i("el-input",{attrs:{type:"textarea",rows:2},model:{value:e.limitDialogFormData.remark,callback:function(t){e.$set(e.limitDialogFormData,"remark",t)},expression:"limitDialogFormData.remark"}})],1)],1),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.limitDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.onLimitDialogSave}},[e._v("保 存")])],1)],1)],1)],1)],1)},l=[],o=(i("7514"),{data:function(){return{filterText:"",treeData:[],tableData:[],serviceId:"",searchFormData:{pageIndex:1,pageSize:5},pageInfo:{list:[],total:0},routeList:[],defaultProps:{children:"children",label:"label"},dlgTitle:"设置限流",limitDialogVisible:!1,limitDialogFormData:{id:0,routeId:"",appKey:"",limitIp:"",limitKey:"",execCountPerSecond:5,limitCode:"",limitMsg:"",tokenBucketCount:5,limitStatus:0,limitType:1,orderIndex:0,remark:"",typeKey:[]},rulesLimit:{typeKey:[{type:"array",required:!0,message:"请至少选择一个",trigger:"change"}],routeId:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],appKey:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],ip:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:500,message:"长度在 1 到 500 个字符",trigger:"blur"}],execCountPerSecond:[{required:!0,message:"不能为空",trigger:"blur"}],limitCode:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:64,message:"长度在 1 到 64 个字符",trigger:"blur"}],limitMsg:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],tokenBucketCount:[{required:!0,message:"不能为空",trigger:"blur"}],orderIndex:[{required:!0,message:"不能为空",trigger:"blur"}],remark:[{max:128,message:"长度不能超过128字符",trigger:"blur"}]}}},watch:{filterText:function(e){this.$refs.tree2.filter(e)}},created:function(){this.loadTree()},methods:{loadTree:function(){this.post("service.list",{},function(e){var t=e.data;this.treeData=this.convertToTreeData(t,0)})},filterNode:function(e,t){return!e||-1!==t.label.indexOf(e)},onNodeClick:function(e,t,i){e.parentId&&(this.serviceId=e.label,this.searchFormData.serviceId=this.serviceId,this.loadTable(),this.loadRouteList(this.serviceId))},convertToTreeData:function(e,t){for(var i=[],a={label:"服务列表",parentId:t},l=[],o=0;osubCode:"+e.limitCode),t.push("
subMsg:"+e.limitMsg)):2===e.limitType&&t.push("令牌桶容量:"+e.tokenBucketCount),t.join("")},onLimitDialogSave:function(){var e=this;this.$refs["limitDialogForm"].validate(function(t){if(t){e.limitDialogFormData.serviceId=e.serviceId;var i=e.limitDialogFormData.id?"config.limit.update":"config.limit.add";e.post(i,e.limitDialogFormData,function(e){this.limitDialogVisible=!1,this.loadTable()})}})},onLimitTypeTipClick:function(){var e="漏桶策略:每秒处理固定数量的请求,超出请求返回错误信息。",t="令牌桶策略:每秒放置固定数量的令牌数,每个请求进来后先去拿令牌,拿到了令牌才能继续,拿不到则等候令牌重新生成了再拿。",i=e+"
"+t;this.$alert(i,"限流策略",{dangerouslyUseHTMLString:!0})},onSizeChange:function(e){this.searchFormData.pageSize=e,this.loadTable()},onPageIndexChange:function(e){this.searchFormData.pageIndex=e,this.loadTable()},onLimitKeyTypeChange:function(e,t){e||(this.limitDialogFormData[t]="")},checkTypeKey:function(e){return this.limitDialogFormData.typeKey.find(function(t,i,a){return t===e})},isLeakyType:function(){return 1===this.limitDialogFormData.limitType},isTokenType:function(){return 2===this.limitDialogFormData.limitType},limitRender:function(e){var t=[],i=[];return e.routeId&&(i.push(e.routeId),t.push("路由ID")),e.appKey&&(i.push(e.appKey),t.push("AppKey")),e.limitIp&&(i.push(e.limitIp),t.push("IP")),i.join(" + ")+"
("+t.join(" + ")+")"}}}),r=o,n=(i("2c81"),i("2877")),s=Object(n["a"])(r,a,l,!1,null,"bf1348ea",null);t["default"]=s.exports},"2c81":function(e,t,i){"use strict";var a=i("a254"),l=i.n(a);l.a},7514:function(e,t,i){"use strict";var a=i("5ca1"),l=i("0a49")(5),o="find",r=!0;o in[]&&Array(1)[o](function(){r=!1}),a(a.P+a.F*r,"Array",{find:function(e){return l(this,e,arguments.length>1?arguments[1]:void 0)}}),i("9c6c")(o)},a254:function(e,t,i){},cd1c:function(e,t,i){var a=i("e853");e.exports=function(e,t){return new(a(e))(t)}},e853:function(e,t,i){var a=i("d3f4"),l=i("1169"),o=i("2b4c")("species");e.exports=function(e){var t;return l(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!l(t.prototype)||(t=void 0),a(t)&&(t=t[o],null===t&&(t=void 0))),void 0===t?Array:t}}}]); \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-ffbffe42.469ef730.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-ffbffe42.469ef730.js new file mode 100644 index 00000000..a5377708 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-ffbffe42.469ef730.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ffbffe42"],{"0a49":function(e,t,i){var a=i("9b43"),l=i("626a"),o=i("4bf8"),r=i("9def"),s=i("cd1c");e.exports=function(e,t){var i=1==e,n=2==e,m=3==e,c=4==e,p=6==e,u=5==e||p,d=t||s;return function(t,s,g){for(var f,h,y=o(t),D=l(y),v=a(s,g,3),b=r(D.length),k=0,x=i?d(t,b):n?d(t,0):void 0;b>k;k++)if((u||k in D)&&(f=D[k],h=v(f,k,y),e))if(i)x[k]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return k;case 2:x.push(f)}else if(c)return!1;return p?-1:m||c?c:x}}},1169:function(e,t,i){var a=i("2d95");e.exports=Array.isArray||function(e){return"Array"==a(e)}},1510:function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("el-container",[i("el-aside",{staticStyle:{"min-height":"300px",width:"200px"}},[i("el-input",{staticStyle:{"margin-bottom":"20px"},attrs:{"prefix-icon":"el-icon-search",placeholder:"搜索服务...",size:"mini",clearable:""},model:{value:e.filterText,callback:function(t){e.filterText=t},expression:"filterText"}}),e._v(" "),i("el-tree",{ref:"tree2",staticClass:"filter-tree",attrs:{data:e.treeData,props:e.defaultProps,"filter-node-method":e.filterNode,"highlight-current":!0,"expand-on-click-node":!1,"empty-text":"无数据","node-key":"id","default-expand-all":""},on:{"node-click":e.onNodeClick},scopedSlots:e._u([{key:"default",fn:function(t){t.node;var a=t.data;return i("span",{staticClass:"custom-tree-node"},[a.label.length<15?i("span",[e._v(e._s(a.label))]):i("span",[i("el-tooltip",{staticClass:"item",attrs:{content:a.label,effect:"light",placement:"right"}},[i("span",[e._v(e._s(a.label.substring(0,15)+"..."))])])],1)])}}])})],1),e._v(" "),i("el-main",{staticStyle:{"padding-top":"0"}},[i("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.searchFormData,size:"mini"}},[i("el-form-item",{attrs:{label:"路由ID"}},[i("el-input",{attrs:{placeholder:"接口名,支持模糊查询",clearable:""},model:{value:e.searchFormData.routeId,callback:function(t){e.$set(e.searchFormData,"routeId",t)},expression:"searchFormData.routeId"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"AppKey"}},[i("el-input",{attrs:{placeholder:"AppKey,支持模糊查询",clearable:""},model:{value:e.searchFormData.appKey,callback:function(t){e.$set(e.searchFormData,"appKey",t)},expression:"searchFormData.appKey"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"IP"}},[i("el-input",{attrs:{placeholder:"ip,支持模糊查询",clearable:""},model:{value:e.searchFormData.limitIp,callback:function(t){e.$set(e.searchFormData,"limitIp",t)},expression:"searchFormData.limitIp"}})],1),e._v(" "),i("el-form-item",[i("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.onSearchTable}},[e._v("查询")])],1)],1),e._v(" "),i("el-button",{staticStyle:{"margin-bottom":"10px"},attrs:{type:"primary",size:"mini",icon:"el-icon-plus"},on:{click:e.onAdd}},[e._v("新增限流")]),e._v(" "),i("el-table",{attrs:{data:e.pageInfo.list,border:""}},[i("el-table-column",{attrs:{prop:"limitKey",label:"限流维度",width:"400"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("div",{domProps:{innerHTML:e._s(e.limitRender(t.row))}})]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"limitType",label:"限流策略",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===t.row.limitType?i("span",[e._v("漏桶策略")]):e._e(),e._v(" "),2===t.row.limitType?i("span",[e._v("令牌桶策略")]):e._e()]}}])},[i("template",{slot:"header"},[e._v("\n 限流策略 "),i("i",{staticClass:"el-icon-question",staticStyle:{cursor:"pointer"},on:{click:e.onLimitTypeTipClick}})])],2),e._v(" "),i("el-table-column",{attrs:{prop:"info",label:"限流信息",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",{domProps:{innerHTML:e._s(e.infoRender(t.row))}})]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"limitStatus",label:"状态",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===t.row.limitStatus?i("span",{staticStyle:{color:"#67C23A"}},[e._v("已开启")]):e._e(),e._v(" "),0===t.row.limitStatus?i("span",{staticStyle:{color:"#909399"}},[e._v("已关闭")]):e._e()]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"orderIndex",label:"排序",width:"80"}}),e._v(" "),i("el-table-column",{attrs:{prop:"remark",label:"备注",width:"150","show-overflow-tooltip":!0}}),e._v(" "),i("el-table-column",{attrs:{prop:"gmtCreate",label:"创建时间",width:"160"}}),e._v(" "),i("el-table-column",{attrs:{prop:"gmtModified",label:"修改时间",width:"160"}}),e._v(" "),i("el-table-column",{attrs:{label:"操作",fixed:"right",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(i){return e.onTableUpdate(t.row)}}},[e._v("修改")])]}}])})],1),e._v(" "),i("el-pagination",{staticStyle:{"margin-top":"5px"},attrs:{background:"","current-page":e.searchFormData.pageIndex,"page-size":e.searchFormData.pageSize,"page-sizes":[5,10,20,40],total:e.pageInfo.total,layout:"total, sizes, prev, pager, next"},on:{"size-change":e.onSizeChange,"current-change":e.onPageIndexChange}}),e._v(" "),i("el-dialog",{attrs:{title:e.dlgTitle,visible:e.limitDialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.limitDialogVisible=t},close:e.onLimitDialogClose}},[i("el-form",{ref:"limitDialogForm",attrs:{model:e.limitDialogFormData,rules:e.rulesLimit,"label-width":"150px",size:"mini"}},[i("el-form-item",{attrs:{label:"限流维度",prop:"typeKey"}},[i("el-checkbox-group",{model:{value:e.limitDialogFormData.typeKey,callback:function(t){e.$set(e.limitDialogFormData,"typeKey",t)},expression:"limitDialogFormData.typeKey"}},[i("el-checkbox",{attrs:{label:1,name:"typeKey"},model:{value:e.limitDialogFormData.typeKey[0],callback:function(t){e.$set(e.limitDialogFormData.typeKey,0,t)},expression:"limitDialogFormData.typeKey[0]"}},[e._v("路由ID")]),e._v(" "),i("el-checkbox",{attrs:{label:2,name:"typeKey"},model:{value:e.limitDialogFormData.typeKey[1],callback:function(t){e.$set(e.limitDialogFormData.typeKey,1,t)},expression:"limitDialogFormData.typeKey[1]"}},[e._v("AppKey")]),e._v(" "),i("el-checkbox",{attrs:{label:3,name:"typeKey"},model:{value:e.limitDialogFormData.typeKey[2],callback:function(t){e.$set(e.limitDialogFormData.typeKey,2,t)},expression:"limitDialogFormData.typeKey[2]"}},[e._v("IP")])],1)],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.checkTypeKey(1),expression:"checkTypeKey(1)"}],attrs:{prop:"routeId",label:"路由ID",rules:e.checkTypeKey(1)?e.rulesLimit.routeId:[]}},[i("el-select",{staticStyle:{width:"300px"},attrs:{filterable:"",placeholder:"可筛选"},model:{value:e.limitDialogFormData.routeId,callback:function(t){e.$set(e.limitDialogFormData,"routeId",t)},expression:"limitDialogFormData.routeId"}},e._l(e.routeList,function(t){return i("el-option",{key:t.id,attrs:{label:t.id,value:t.id}},[i("span",{staticStyle:{float:"left"}},[e._v(e._s(t.name))]),e._v(" "),i("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"13px"}},[e._v(e._s(t.version))])])}),1)],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.checkTypeKey(2),expression:"checkTypeKey(2)"}],attrs:{prop:"appKey",label:"AppKey",rules:e.checkTypeKey(2)?e.rulesLimit.appKey:[]}},[i("el-input",{attrs:{placeholder:"需要限流的appKey"},model:{value:e.limitDialogFormData.appKey,callback:function(t){e.$set(e.limitDialogFormData,"appKey",t)},expression:"limitDialogFormData.appKey"}})],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.checkTypeKey(3),expression:"checkTypeKey(3)"}],attrs:{label:"限流IP",prop:"limitIp",rules:e.checkTypeKey(3)?e.rulesLimit.ip:[]}},[i("el-input",{attrs:{type:"textarea",rows:2,placeholder:"多个用英文逗号隔开"},model:{value:e.limitDialogFormData.limitIp,callback:function(t){e.$set(e.limitDialogFormData,"limitIp",t)},expression:"limitDialogFormData.limitIp"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"限流策略"}},[i("el-radio-group",{model:{value:e.limitDialogFormData.limitType,callback:function(t){e.$set(e.limitDialogFormData,"limitType",t)},expression:"limitDialogFormData.limitType"}},[i("el-radio",{attrs:{label:1}},[e._v("漏桶策略")]),e._v(" "),i("el-radio",{attrs:{label:2}},[e._v("令牌桶策略")])],1),e._v(" "),i("i",{staticClass:"el-icon-question limit-tip",on:{click:e.onLimitTypeTipClick}})],1),e._v(" "),i("el-form-item",{attrs:{label:"开启状态"}},[i("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#ff4949","active-value":1,"inactive-value":0},model:{value:e.limitDialogFormData.limitStatus,callback:function(t){e.$set(e.limitDialogFormData,"limitStatus",t)},expression:"limitDialogFormData.limitStatus"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"排序",prop:"orderIndex"}},[i("el-input-number",{attrs:{"controls-position":"right",min:0},model:{value:e.limitDialogFormData.orderIndex,callback:function(t){e.$set(e.limitDialogFormData,"orderIndex",t)},expression:"limitDialogFormData.orderIndex"}}),e._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"值小优先执行",placement:"top"}},[i("i",{staticClass:"el-icon-question limit-tip"})])],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.isLeakyType(),expression:"isLeakyType()"}],attrs:{label:"每秒可处理请求数",prop:"execCountPerSecond",rules:e.isLeakyType()?e.rulesLimit.execCountPerSecond:[]}},[i("el-input-number",{attrs:{"controls-position":"right",min:1},model:{value:e.limitDialogFormData.execCountPerSecond,callback:function(t){e.$set(e.limitDialogFormData,"execCountPerSecond",t)},expression:"limitDialogFormData.execCountPerSecond"}})],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.isLeakyType(),expression:"isLeakyType()"}],attrs:{label:"错误码",prop:"limitCode",rules:e.isLeakyType()?e.rulesLimit.limitCode:[]}},[i("el-input",{model:{value:e.limitDialogFormData.limitCode,callback:function(t){e.$set(e.limitDialogFormData,"limitCode",t)},expression:"limitDialogFormData.limitCode"}})],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.isLeakyType(),expression:"isLeakyType()"}],attrs:{label:"错误信息",prop:"limitMsg",rules:e.isLeakyType()?e.rulesLimit.limitMsg:[]}},[i("el-input",{model:{value:e.limitDialogFormData.limitMsg,callback:function(t){e.$set(e.limitDialogFormData,"limitMsg",t)},expression:"limitDialogFormData.limitMsg"}})],1),e._v(" "),i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.isTokenType(),expression:"isTokenType()"}],attrs:{label:"令牌桶容量",prop:"tokenBucketCount",rules:e.isTokenType()?e.rulesLimit.tokenBucketCount:[]}},[i("el-input-number",{attrs:{"controls-position":"right",min:1},model:{value:e.limitDialogFormData.tokenBucketCount,callback:function(t){e.$set(e.limitDialogFormData,"tokenBucketCount",t)},expression:"limitDialogFormData.tokenBucketCount"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"备注",prop:"remark"}},[i("el-input",{attrs:{type:"textarea",rows:2},model:{value:e.limitDialogFormData.remark,callback:function(t){e.$set(e.limitDialogFormData,"remark",t)},expression:"limitDialogFormData.remark"}})],1)],1),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.limitDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.onLimitDialogSave}},[e._v("保 存")])],1)],1)],1)],1)],1)},l=[],o=(i("7514"),{data:function(){return{filterText:"",treeData:[],tableData:[],serviceId:"",searchFormData:{pageIndex:1,pageSize:5},pageInfo:{list:[],total:0},routeList:[],defaultProps:{children:"children",label:"label"},dlgTitle:"设置限流",limitDialogVisible:!1,limitDialogFormData:{id:0,routeId:"",appKey:"",limitIp:"",limitKey:"",execCountPerSecond:5,limitCode:"",limitMsg:"",tokenBucketCount:5,limitStatus:0,limitType:1,orderIndex:0,remark:"",typeKey:[]},rulesLimit:{typeKey:[{type:"array",required:!0,message:"请至少选择一个",trigger:"change"}],routeId:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],appKey:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],ip:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:500,message:"长度在 1 到 500 个字符",trigger:"blur"}],execCountPerSecond:[{required:!0,message:"不能为空",trigger:"blur"}],limitCode:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:64,message:"长度在 1 到 64 个字符",trigger:"blur"}],limitMsg:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],tokenBucketCount:[{required:!0,message:"不能为空",trigger:"blur"}],orderIndex:[{required:!0,message:"不能为空",trigger:"blur"}],remark:[{max:128,message:"长度不能超过128字符",trigger:"blur"}]}}},watch:{filterText:function(e){this.$refs.tree2.filter(e)}},created:function(){this.loadTree()},methods:{loadTree:function(){this.post("service.list",{},function(e){var t=e.data;this.treeData=this.convertToTreeData(t,0)})},filterNode:function(e,t){return!e||-1!==t.label.indexOf(e)},onNodeClick:function(e,t,i){e.parentId&&(this.serviceId=e.label,this.searchFormData.serviceId=this.serviceId,this.loadTable(),this.loadRouteList(this.serviceId))},convertToTreeData:function(e,t){for(var i=[],a={label:"服务列表",parentId:t},l=[],o=0;osubCode:"+e.limitCode),t.push("
subMsg:"+e.limitMsg)):2===e.limitType&&t.push("令牌桶容量:"+e.tokenBucketCount),t.join("")},onLimitDialogSave:function(){var e=this;this.$refs["limitDialogForm"].validate(function(t){if(t){e.cleanCheckboxData(),e.limitDialogFormData.serviceId=e.serviceId;var i=e.limitDialogFormData.id?"config.limit.update":"config.limit.add";e.post(i,e.limitDialogFormData,function(e){this.limitDialogVisible=!1,this.loadTable()})}})},cleanCheckboxData:function(){this.checkTypeKey(1)||(this.limitDialogFormData.routeId=""),this.checkTypeKey(2)||(this.limitDialogFormData.appKey=""),this.checkTypeKey(3)||(this.limitDialogFormData.limitIp="")},onLimitTypeTipClick:function(){var e="漏桶策略:每秒处理固定数量的请求,超出请求返回错误信息。",t="令牌桶策略:每秒放置固定数量的令牌数,每个请求进来后先去拿令牌,拿到了令牌才能继续,拿不到则等候令牌重新生成了再拿。",i=e+"
"+t;this.$alert(i,"限流策略",{dangerouslyUseHTMLString:!0})},onSizeChange:function(e){this.searchFormData.pageSize=e,this.loadTable()},onPageIndexChange:function(e){this.searchFormData.pageIndex=e,this.loadTable()},checkTypeKey:function(e){return this.limitDialogFormData.typeKey.find(function(t,i,a){return t===e})},isLeakyType:function(){return 1===this.limitDialogFormData.limitType},isTokenType:function(){return 2===this.limitDialogFormData.limitType},limitRender:function(e){var t=[],i=[];return e.routeId&&(i.push(e.routeId),t.push("路由ID")),e.appKey&&(i.push(e.appKey),t.push("AppKey")),e.limitIp&&(i.push(e.limitIp),t.push("IP")),i.join(" + ")+"
("+t.join(" + ")+")"}}}),r=o,s=(i("d511"),i("2877")),n=Object(s["a"])(r,a,l,!1,null,"b54eb5a0",null);t["default"]=n.exports},7514:function(e,t,i){"use strict";var a=i("5ca1"),l=i("0a49")(5),o="find",r=!0;o in[]&&Array(1)[o](function(){r=!1}),a(a.P+a.F*r,"Array",{find:function(e){return l(this,e,arguments.length>1?arguments[1]:void 0)}}),i("9c6c")(o)},"9b37":function(e,t,i){},cd1c:function(e,t,i){var a=i("e853");e.exports=function(e,t){return new(a(e))(t)}},d511:function(e,t,i){"use strict";var a=i("9b37"),l=i.n(a);l.a},e853:function(e,t,i){var a=i("d3f4"),l=i("1169"),o=i("2b4c")("species");e.exports=function(e){var t;return l(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!l(t.prototype)||(t=void 0),a(t)&&(t=t[o],null===t&&(t=void 0))),void 0===t?Array:t}}}]); \ No newline at end of file diff --git a/sop-admin/sop-admin-vue/src/views/service/limit/index2.vue b/sop-admin/sop-admin-vue/src/views/service/limit/index2.vue index 407a52c4..6d3efa36 100644 --- a/sop-admin/sop-admin-vue/src/views/service/limit/index2.vue +++ b/sop-admin/sop-admin-vue/src/views/service/limit/index2.vue @@ -145,9 +145,9 @@ > - 路由ID - AppKey - IP + 路由ID + AppKey + IP @@ -429,6 +429,7 @@ export default { onLimitDialogSave: function() { this.$refs['limitDialogForm'].validate((valid) => { if (valid) { + this.cleanCheckboxData() this.limitDialogFormData.serviceId = this.serviceId const uri = this.limitDialogFormData.id ? 'config.limit.update' : 'config.limit.add' this.post(uri, this.limitDialogFormData, function(resp) { @@ -438,6 +439,18 @@ export default { } }) }, + cleanCheckboxData: function() { + // 如果没有勾选则清空 + if (!this.checkTypeKey(1)) { + this.limitDialogFormData.routeId = '' + } + if (!this.checkTypeKey(2)) { + this.limitDialogFormData.appKey = '' + } + if (!this.checkTypeKey(3)) { + this.limitDialogFormData.limitIp = '' + } + }, onLimitTypeTipClick: function() { const leakyRemark = '漏桶策略:每秒处理固定数量的请求,超出请求返回错误信息。' const tokenRemark = '令牌桶策略:每秒放置固定数量的令牌数,每个请求进来后先去拿令牌,拿到了令牌才能继续,拿不到则等候令牌重新生成了再拿。' @@ -454,11 +467,6 @@ export default { this.searchFormData.pageIndex = pageIndex this.loadTable() }, - onLimitKeyTypeChange: function(checked, name) { - if (!checked) { - this.limitDialogFormData[name] = '' - } - }, checkTypeKey: function(val) { return this.limitDialogFormData.typeKey.find((value, index, arr) => { return value === val