diff --git a/web/admin/index.html b/web/admin/index.html index 6468e30..02d4f0c 100644 --- a/web/admin/index.html +++ b/web/admin/index.html @@ -1 +1 @@ -Jump Jump Admin
\ No newline at end of file +Jump Jump Admin
\ No newline at end of file diff --git a/web/admin/static/css/chunk-0cef0a8e.019a7ae2.css b/web/admin/static/css/chunk-0cef0a8e.019a7ae2.css deleted file mode 100644 index 66229a4..0000000 --- a/web/admin/static/css/chunk-0cef0a8e.019a7ae2.css +++ /dev/null @@ -1 +0,0 @@ -.paginator-container[data-v-11546d78]{margin-top:10px} \ No newline at end of file diff --git a/web/admin/static/css/chunk-36236bc7.50641768.css b/web/admin/static/css/chunk-36236bc7.50641768.css new file mode 100644 index 0000000..ff17abe --- /dev/null +++ b/web/admin/static/css/chunk-36236bc7.50641768.css @@ -0,0 +1 @@ +.paginator-container[data-v-03386dae]{margin-top:10px} \ No newline at end of file diff --git a/web/admin/static/css/chunk-545a7d9d.10ca9b5d.css b/web/admin/static/css/chunk-545a7d9d.10ca9b5d.css deleted file mode 100644 index 7baf221..0000000 --- a/web/admin/static/css/chunk-545a7d9d.10ca9b5d.css +++ /dev/null @@ -1 +0,0 @@ -.paginator-container[data-v-65f1ccf6]{margin-top:10px} \ No newline at end of file diff --git a/web/admin/static/js/app.981b785e.js b/web/admin/static/js/app.35533cf5.js similarity index 99% rename from web/admin/static/js/app.981b785e.js rename to web/admin/static/js/app.35533cf5.js index 11f9319..08b17d5 100644 --- a/web/admin/static/js/app.981b785e.js +++ b/web/admin/static/js/app.35533cf5.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app"],{0:function(e,t,n){e.exports=n("56d7")},"028b":function(e,t,n){"use strict";var a=n("f12c"),s=n.n(a);s.a},"031b":function(e,t,n){},"186a":function(e,t,n){"use strict";var a=n("dc52"),s=n.n(a);s.a},"18f0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},2995:function(e,t,n){},"2a3d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});r.a.add(o);t["default"]=o},3289:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-list",use:"icon-list-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},"34c8":function(e,t,n){"use strict";var a=n("88a1"),s=n.n(a);s.a},4360:function(e,t,n){"use strict";var a=n("2b0e"),s=n("2f62"),i=(n("7f7f"),{sidebar:function(e){return e.app.sidebar},device:function(e){return e.app.device},token:function(e){return e.user.token},name:function(e){return e.user.name},role:function(e){return e.user.role}}),r=i,o=n("a78e"),c=n.n(o),u={sidebar:{opened:!c.a.get("sidebarStatus")||!!+c.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop"},d={TOGGLE_SIDEBAR:function(e){e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1,e.sidebar.opened?c.a.set("sidebarStatus",1):c.a.set("sidebarStatus",0)},CLOSE_SIDEBAR:function(e,t){c.a.set("sidebarStatus",0),e.sidebar.opened=!1,e.sidebar.withoutAnimation=t},TOGGLE_DEVICE:function(e,t){e.device=t}},l={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)}},f={namespaced:!0,state:u,mutations:d,actions:l},h=n("83d6"),b=n.n(h),m=b.a.showSettings,p=b.a.fixedHeader,v=b.a.sidebarLogo,g={showSettings:m,fixedHeader:p,sidebarLogo:v},j={CHANGE_SETTING:function(e,t){var n=t.key,a=t.value;e.hasOwnProperty(n)&&(e[n]=a)}},w={changeSetting:function(e,t){var n=e.commit;n("CHANGE_SETTING",t)}},k={namespaced:!0,state:g,mutations:j,actions:w},y=n("c24f"),x=n("5f87"),_=n("a18c"),C=function(){return{token:Object(x["a"])(),name:"",role:1}},z=C(),O={RESET_STATE:function(e){Object.assign(e,C())},SET_TOKEN:function(e,t){e.token=t},SET_NAME:function(e,t){e.name=t},SET_ROLE:function(e,t){e.role=t}},S={login:function(e,t){var n=e.commit,a=t.username,s=t.password;return new Promise((function(e,t){Object(y["c"])({username:a.trim(),password:s}).then((function(t){var a=t.data;n("SET_TOKEN",a.token),Object(x["c"])(a.token),e()})).catch((function(e){t(e)}))}))},getInfo:function(e){var t=e.commit;e.state;return new Promise((function(e,n){Object(y["b"])().then((function(a){var s=a.data;s||n("登入信息验证失败,请重新登入");var i=s.username,r=s.role;t("SET_NAME",i),t("SET_ROLE",r),e(s)})).catch((function(e){n(e)}))}))},logout:function(e){var t=e.commit,n=e.state;return new Promise((function(e,a){Object(y["d"])(n.token).then((function(){Object(x["b"])(),Object(_["b"])(),t("RESET_STATE"),e()})).catch((function(e){a(e)}))}))},resetToken:function(e){var t=e.commit;return new Promise((function(e){Object(x["b"])(),t("RESET_STATE"),e()}))}},E={namespaced:!0,state:z,mutations:O,actions:S};a["default"].use(s["a"]);var M=new s["a"].Store({modules:{app:f,settings:k,user:E},getters:r});t["a"]=M},4678:function(e,t,n){var a={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-SG":"cdab","./en-SG.js":"cdab","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-nz":"6f50","./en-nz.js":"6f50","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-tw":"90ea","./zh-tw.js":"90ea"};function s(e){var t=i(e);return n(t)}function i(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}s.keys=function(){return Object.keys(a)},s.resolve=i,e.exports=s,s.id="4678"},"4cdc":function(e,t,n){},"4df5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});r.a.add(o);t["default"]=o},"51ff":function(e,t,n){var a={"./add.svg":"c2a3","./dashboard.svg":"f782","./eye-open.svg":"d7ec","./eye.svg":"4df5","./form.svg":"eb1b","./github.svg":"558d","./link.svg":"18f0","./list.svg":"3289","./password.svg":"2a3d","./user.svg":"b3b5"};function s(e){var t=i(e);return n(t)}function i(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}s.keys=function(){return Object.keys(a)},s.resolve=i,e.exports=s,s.id="51ff"},"558d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-github",use:"icon-github-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var a=n("2b0e"),s=n("c1df"),i=n.n(s),r=(n("f5df"),n("5c96")),o=n.n(r),c=(n("0fae"),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=[],d={name:"App"},l=d,f=n("2877"),h=Object(f["a"])(l,c,u,!1,null,null,null),b=h.exports,m=n("4360"),p=n("a18c"),v=(n("ac6a"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isExternal?n("div",e._g({staticClass:"svg-external-icon svg-icon",style:e.styleExternalIcon},e.$listeners)):n("svg",e._g({class:e.svgClass,attrs:{"aria-hidden":"true"}},e.$listeners),[n("use",{attrs:{href:e.iconName}})])}),g=[],j=n("61f7"),w={name:"SvgIcon",props:{iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{isExternal:function(){return Object(j["a"])(this.iconClass)},iconName:function(){return"#icon-".concat(this.iconClass)},svgClass:function(){return this.className?"svg-icon "+this.className:"svg-icon"},styleExternalIcon:function(){return{mask:"url(".concat(this.iconClass,") no-repeat 50% 50%"),"-webkit-mask":"url(".concat(this.iconClass,") no-repeat 50% 50%")}}}},k=w,y=(n("d1a7"),Object(f["a"])(k,v,g,!1,null,"4342976c",null)),x=y.exports;a["default"].component("svg-icon",x);var _=n("51ff"),C=function(e){return e.keys().map(e)};C(_);n("7f7f"),n("96cf");var z=n("3b8d"),O=n("323e"),S=n.n(O),E=(n("a5d8"),n("5f87")),M=n("83d6"),B=n.n(M),T=B.a.title||"Vue Admin Template";function L(e){return e?"".concat(e," - ").concat(T):"".concat(T)}S.a.configure({showSpinner:!1});var $=["/login"];p["a"].beforeEach(function(){var e=Object(z["a"])(regeneratorRuntime.mark((function e(t,n,a){var s,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(S.a.start(),document.title=L(t.meta.title),s=Object(E["a"])(),!s){e.next=29;break}if("/login"!==t.path){e.next=9;break}a({path:"/"}),S.a.done(),e.next=27;break;case 9:if(i=m["a"].getters.name,!i){e.next=14;break}a(),e.next=27;break;case 14:return e.prev=14,e.next=17,m["a"].dispatch("user/getInfo");case 17:a(),e.next=27;break;case 20:return e.prev=20,e.t0=e["catch"](14),e.next=24,m["a"].dispatch("user/resetToken");case 24:r["Message"].error(e.t0||"Has Error"),a("/login?redirect=".concat(t.path)),S.a.done();case 27:e.next=30;break;case 29:-1!==$.indexOf(t.path)?a():(a("/login?redirect=".concat(t.path)),S.a.done());case 30:case"end":return e.stop()}}),e,null,[[14,20]])})));return function(t,n,a){return e.apply(this,arguments)}}()),p["a"].afterEach((function(){S.a.done()})),a["default"].filter("dateformat",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD HH:mm:ss";return e?i()(e).format(t):"-"})),a["default"].use(o.a),a["default"].config.productionTip=!1,new a["default"]({el:"#app",router:p["a"],store:m["a"],render:function(e){return e(b)}})},"5f87":function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return c}));var a=n("a78e"),s=n.n(a),i="j2_token";function r(){return s.a.get(i)}function o(e){return s.a.set(i,e)}function c(){return s.a.remove(i)}},"61f7":function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return r}));n("3b2b");function a(e){return/^(https?:|mailto:|tel:)/.test(e)}function s(e){return e.length>=2}var i=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|localhost|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\#[-a-z\\d_\\/]*)?(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");function r(e){return!!i.test(e)}},"6b31":function(e,t,n){"use strict";var a=n("4cdc"),s=n.n(a);s.a},"83d6":function(e,t){e.exports={title:"Jump Jump Admin",fixedHeader:!1,sidebarLogo:!1}},"88a1":function(e,t,n){},8902:function(e,t,n){},"9f2b":function(e,t,n){"use strict";var a=n("bf90"),s=n.n(a);s.a},"9f43":function(e,t,n){"use strict";var a=n("2995"),s=n.n(a);s.a},a18c:function(e,t,n){"use strict";var a,s,i=n("2b0e"),r=n("8c4f"),o=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)},c=[],u=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-dropdown",{staticClass:"username-container",attrs:{trigger:"click"}},[n("div",{staticClass:"username-wrapper"},[n("span",{staticStyle:{cursor:"pointer"}},[e._v(e._s(e.name))])]),e._v(" "),n("el-dropdown-menu",{staticClass:"user-dropdown",attrs:{slot:"dropdown"},slot:"dropdown"},[n("router-link",{attrs:{to:"/"}},[n("el-dropdown-item",[e._v("首页")])],1),e._v(" "),n("router-link",{attrs:{to:"/security/change-password"}},[n("el-dropdown-item",[e._v("修改密码")])],1),e._v(" "),n("a",{attrs:{target:"_blank",href:"https://github.com/jwma/jump-jump"}},[n("el-dropdown-item",[e._v("Github")])],1),e._v(" "),n("el-dropdown-item",{attrs:{divided:""},nativeOn:{click:function(t){return e.logout(t)}}},[n("span",{staticStyle:{display:"block"}},[e._v("登出")])])],1)],1)],1)],1)},d=[],l=(n("96cf"),n("3b8d")),f=n("db72"),h=n("2f62"),b=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)},m=[],p=(n("7f7f"),n("bd11")),v=n.n(p),g={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=v.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))}}},j=g,w=(n("34c8"),n("2877")),k=Object(w["a"])(j,b,m,!1,null,"62cc9144",null),y=k.exports,x=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"}})])])},_=[],C={name:"Hamburger",props:{isActive:{type:Boolean,default:!1}},methods:{toggleClick:function(){this.$emit("toggleClick")}}},z=C,O=(n("186a"),Object(w["a"])(z,x,_,!1,null,"49e15297",null)),S=O.exports,E={components:{Breadcrumb:y,Hamburger:S},computed:Object(f["a"])({},Object(h["b"])(["sidebar","name"])),methods:{toggleSideBar:function(){this.$store.dispatch("app/toggleSideBar")},logout:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.$store.dispatch("user/logout");case 2:this.$router.push("/login?redirect=".concat(this.$route.fullPath));case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}},M=E,B=(n("9f43"),Object(w["a"])(M,u,d,!1,null,"26745010",null)),T=B.exports,L=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)},$=[],A=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)},H=[],D={name:"SidebarLogo",props:{collapse:{type:Boolean,required:!0}},data:function(){return{title:"Vue Admin Template",logo:"https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png"}}},P=D,I=(n("6b31"),Object(w["a"])(P,A,H,!1,null,"5bb1c0e2",null)),N=I.exports,q=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.item.hidden?e._e():n("div",[!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)},R=[],G=n("df7c"),V=n.n(G),F=n("61f7"),U={name:"MenuItem",functional:!0,props:{icon:{type:String,default:""},title:{type:String,default:""}},render:function(e,t){var n=t.props,a=n.icon,s=n.title,i=[];return a&&i.push(e("svg-icon",{attrs:{"icon-class":a}})),s&&i.push(e("span",{slot:"title"},[s])),i}},J=U,Y=Object(w["a"])(J,a,s,!1,null,null,null),K=Y.exports,W=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)},Q=[],X={props:{to:{type:String,required:!0}},methods:{linkProps:function(e){return Object(F["a"])(e)?{is:"a",href:e,target:"_blank",rel:"noopener"}:{is:"router-link",to:e}}}},Z=X,ee=Object(w["a"])(Z,W,Q,!1,null,null,null),te=ee.exports,ne={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)}}}}},ae={name:"SidebarItem",components:{Item:K,AppLink:te},mixins:[ne],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(f["a"])({},n,{path:"",noShowingChildren:!0}),!0)},resolvePath:function(e){return Object(F["a"])(e)?e:Object(F["a"])(this.basePath)?this.basePath:V.a.resolve(this.basePath,e)}}},se=ae,ie=Object(w["a"])(se,q,R,!1,null,null,null),re=ie.exports,oe=n("cf1e2"),ce=n.n(oe),ue={components:{SidebarItem:re,Logo:N},computed:Object(f["a"])({},Object(h["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 ce.a},isCollapse:function(){return!this.sidebar.opened}})},de=ue,le=Object(w["a"])(de,L,$,!1,null,null,null),fe=le.exports,he=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)},be=[],me={name:"AppMain",computed:{key:function(){return this.$route.path}}},pe=me,ve=(n("e4de"),n("028b"),Object(w["a"])(pe,he,be,!1,null,"64cf4d83",null)),ge=ve.exports,je=n("4360"),we=document,ke=we.body,ye=992,xe={watch:{$route:function(e){"mobile"===this.device&&this.sidebar.opened&&je["a"].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&&(je["a"].dispatch("app/toggleDevice","mobile"),je["a"].dispatch("app/closeSideBar",{withoutAnimation:!0}))},methods:{$_isMobile:function(){var e=ke.getBoundingClientRect();return e.width-1'});r.a.add(o);t["default"]=o},b775:function(e,t,n){"use strict";var a=n("bc3a"),s=n.n(a),i=n("5c96"),r=n("4360"),o=n("5f87"),c=s.a.create({baseURL:"",timeout:5e3});c.interceptors.request.use((function(e){return r["a"].getters.token&&(e.headers["Authorization"]="Bearer "+Object(o["a"])()),e}),(function(e){return console.log(e),Promise.reject(e)})),c.interceptors.response.use((function(e){var t=e.data;return 4999===t.code?(Object(i["Message"])({message:t.msg||"Error",type:"error",duration:5e3}),Promise.reject(new Error(t.message||"Error"))):t}),(function(e){var t=e.response;return 401===t.status?i["MessageBox"].confirm("你的登入已过期,请重新登入","登入过期",{confirmButtonText:"重新登入",cancelButtonText:"取消",type:"warning"}).then((function(){r["a"].dispatch("user/resetToken").then((function(){location.reload()}))})):500===t.status&&Object(i["Message"])({message:"服务器繁忙,请稍后再试...",type:"error",duration:5e3}),Promise.reject(e)})),t["a"]=c},bf90:function(e,t,n){},c24f:function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"a",(function(){return o}));var a=n("b775");function s(e){return Object(a["a"])({url:"/v1/user/login",method:"post",data:e})}function i(){return Object(a["a"])({url:"/v1/user/info",method:"get"})}function r(){return Object(a["a"])({url:"/v1/user/logout",method:"post"})}function o(e){return Object(a["a"])({url:"/v1/user/change-password",method:"patch",data:e})}},c2a3:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-add",use:"icon-add-usage",viewBox:"0 0 1026 1024",content:''});r.a.add(o);t["default"]=o},cf1e2:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409EFF",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},d1a7:function(e,t,n){"use strict";var a=n("031b"),s=n.n(a);s.a},d7ec:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-eye-open",use:"icon-eye-open-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},dc52:function(e,t,n){},e4de:function(e,t,n){"use strict";var a=n("8902"),s=n.n(a);s.a},eb1b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});r.a.add(o);t["default"]=o},f12c:function(e,t,n){},f782:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-dashboard",use:"icon-dashboard-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o}},[[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")},"028b":function(e,t,n){"use strict";var a=n("f12c"),s=n.n(a);s.a},"031b":function(e,t,n){},"186a":function(e,t,n){"use strict";var a=n("dc52"),s=n.n(a);s.a},"18f0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},2995:function(e,t,n){},"2a3d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});r.a.add(o);t["default"]=o},3289:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-list",use:"icon-list-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},"34c8":function(e,t,n){"use strict";var a=n("88a1"),s=n.n(a);s.a},4360:function(e,t,n){"use strict";var a=n("2b0e"),s=n("2f62"),i=(n("7f7f"),{sidebar:function(e){return e.app.sidebar},device:function(e){return e.app.device},token:function(e){return e.user.token},name:function(e){return e.user.name},role:function(e){return e.user.role}}),r=i,o=n("a78e"),c=n.n(o),u={sidebar:{opened:!c.a.get("sidebarStatus")||!!+c.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop"},d={TOGGLE_SIDEBAR:function(e){e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1,e.sidebar.opened?c.a.set("sidebarStatus",1):c.a.set("sidebarStatus",0)},CLOSE_SIDEBAR:function(e,t){c.a.set("sidebarStatus",0),e.sidebar.opened=!1,e.sidebar.withoutAnimation=t},TOGGLE_DEVICE:function(e,t){e.device=t}},l={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)}},f={namespaced:!0,state:u,mutations:d,actions:l},h=n("83d6"),b=n.n(h),m=b.a.showSettings,p=b.a.fixedHeader,v=b.a.sidebarLogo,g={showSettings:m,fixedHeader:p,sidebarLogo:v},j={CHANGE_SETTING:function(e,t){var n=t.key,a=t.value;e.hasOwnProperty(n)&&(e[n]=a)}},w={changeSetting:function(e,t){var n=e.commit;n("CHANGE_SETTING",t)}},k={namespaced:!0,state:g,mutations:j,actions:w},y=n("c24f"),x=n("5f87"),_=n("a18c"),C=function(){return{token:Object(x["a"])(),name:"",role:1}},z=C(),O={RESET_STATE:function(e){Object.assign(e,C())},SET_TOKEN:function(e,t){e.token=t},SET_NAME:function(e,t){e.name=t},SET_ROLE:function(e,t){e.role=t}},S={login:function(e,t){var n=e.commit,a=t.username,s=t.password;return new Promise((function(e,t){Object(y["c"])({username:a.trim(),password:s}).then((function(t){var a=t.data;n("SET_TOKEN",a.token),Object(x["c"])(a.token),e()})).catch((function(e){t(e)}))}))},getInfo:function(e){var t=e.commit;e.state;return new Promise((function(e,n){Object(y["b"])().then((function(a){var s=a.data;s||n("登入信息验证失败,请重新登入");var i=s.username,r=s.role;t("SET_NAME",i),t("SET_ROLE",r),e(s)})).catch((function(e){n(e)}))}))},logout:function(e){var t=e.commit,n=e.state;return new Promise((function(e,a){Object(y["d"])(n.token).then((function(){Object(x["b"])(),Object(_["b"])(),t("RESET_STATE"),e()})).catch((function(e){a(e)}))}))},resetToken:function(e){var t=e.commit;return new Promise((function(e){Object(x["b"])(),t("RESET_STATE"),e()}))}},E={namespaced:!0,state:z,mutations:O,actions:S};a["default"].use(s["a"]);var M=new s["a"].Store({modules:{app:f,settings:k,user:E},getters:r});t["a"]=M},4678:function(e,t,n){var a={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-SG":"cdab","./en-SG.js":"cdab","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-nz":"6f50","./en-nz.js":"6f50","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-tw":"90ea","./zh-tw.js":"90ea"};function s(e){var t=i(e);return n(t)}function i(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}s.keys=function(){return Object.keys(a)},s.resolve=i,e.exports=s,s.id="4678"},"4cdc":function(e,t,n){},"4df5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});r.a.add(o);t["default"]=o},"51ff":function(e,t,n){var a={"./add.svg":"c2a3","./dashboard.svg":"f782","./eye-open.svg":"d7ec","./eye.svg":"4df5","./form.svg":"eb1b","./github.svg":"558d","./link.svg":"18f0","./list.svg":"3289","./password.svg":"2a3d","./user.svg":"b3b5"};function s(e){var t=i(e);return n(t)}function i(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}s.keys=function(){return Object.keys(a)},s.resolve=i,e.exports=s,s.id="51ff"},"558d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-github",use:"icon-github-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var a=n("2b0e"),s=n("c1df"),i=n.n(s),r=(n("f5df"),n("5c96")),o=n.n(r),c=(n("0fae"),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=[],d={name:"App"},l=d,f=n("2877"),h=Object(f["a"])(l,c,u,!1,null,null,null),b=h.exports,m=n("4360"),p=n("a18c"),v=(n("ac6a"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isExternal?n("div",e._g({staticClass:"svg-external-icon svg-icon",style:e.styleExternalIcon},e.$listeners)):n("svg",e._g({class:e.svgClass,attrs:{"aria-hidden":"true"}},e.$listeners),[n("use",{attrs:{href:e.iconName}})])}),g=[],j=n("61f7"),w={name:"SvgIcon",props:{iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{isExternal:function(){return Object(j["a"])(this.iconClass)},iconName:function(){return"#icon-".concat(this.iconClass)},svgClass:function(){return this.className?"svg-icon "+this.className:"svg-icon"},styleExternalIcon:function(){return{mask:"url(".concat(this.iconClass,") no-repeat 50% 50%"),"-webkit-mask":"url(".concat(this.iconClass,") no-repeat 50% 50%")}}}},k=w,y=(n("d1a7"),Object(f["a"])(k,v,g,!1,null,"4342976c",null)),x=y.exports;a["default"].component("svg-icon",x);var _=n("51ff"),C=function(e){return e.keys().map(e)};C(_);n("7f7f"),n("96cf");var z=n("3b8d"),O=n("323e"),S=n.n(O),E=(n("a5d8"),n("5f87")),M=n("83d6"),B=n.n(M),T=B.a.title||"Vue Admin Template";function L(e){return e?"".concat(e," - ").concat(T):"".concat(T)}S.a.configure({showSpinner:!1});var $=["/login"];p["a"].beforeEach(function(){var e=Object(z["a"])(regeneratorRuntime.mark((function e(t,n,a){var s,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(S.a.start(),document.title=L(t.meta.title),s=Object(E["a"])(),!s){e.next=29;break}if("/login"!==t.path){e.next=9;break}a({path:"/"}),S.a.done(),e.next=27;break;case 9:if(i=m["a"].getters.name,!i){e.next=14;break}a(),e.next=27;break;case 14:return e.prev=14,e.next=17,m["a"].dispatch("user/getInfo");case 17:a(),e.next=27;break;case 20:return e.prev=20,e.t0=e["catch"](14),e.next=24,m["a"].dispatch("user/resetToken");case 24:r["Message"].error(e.t0||"Has Error"),a("/login?redirect=".concat(t.path)),S.a.done();case 27:e.next=30;break;case 29:-1!==$.indexOf(t.path)?a():(a("/login?redirect=".concat(t.path)),S.a.done());case 30:case"end":return e.stop()}}),e,null,[[14,20]])})));return function(t,n,a){return e.apply(this,arguments)}}()),p["a"].afterEach((function(){S.a.done()})),a["default"].filter("dateformat",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD HH:mm:ss";return e?i()(e).format(t):"-"})),a["default"].use(o.a),a["default"].config.productionTip=!1,new a["default"]({el:"#app",router:p["a"],store:m["a"],render:function(e){return e(b)}})},"5f87":function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return c}));var a=n("a78e"),s=n.n(a),i="j2_token";function r(){return s.a.get(i)}function o(e){return s.a.set(i,e)}function c(){return s.a.remove(i)}},"61f7":function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return r}));n("3b2b");function a(e){return/^(https?:|mailto:|tel:)/.test(e)}function s(e){return e.length>=2}var i=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|localhost|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\#[-a-z\\d_\\/]*)?(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");function r(e){return!!i.test(e)}},"6b31":function(e,t,n){"use strict";var a=n("4cdc"),s=n.n(a);s.a},"83d6":function(e,t){e.exports={title:"Jump Jump Admin",fixedHeader:!1,sidebarLogo:!1}},"88a1":function(e,t,n){},8902:function(e,t,n){},"9f2b":function(e,t,n){"use strict";var a=n("bf90"),s=n.n(a);s.a},"9f43":function(e,t,n){"use strict";var a=n("2995"),s=n.n(a);s.a},a18c:function(e,t,n){"use strict";var a,s,i=n("2b0e"),r=n("8c4f"),o=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)},c=[],u=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-dropdown",{staticClass:"username-container",attrs:{trigger:"click"}},[n("div",{staticClass:"username-wrapper"},[n("span",{staticStyle:{cursor:"pointer"}},[e._v(e._s(e.name))])]),e._v(" "),n("el-dropdown-menu",{staticClass:"user-dropdown",attrs:{slot:"dropdown"},slot:"dropdown"},[n("router-link",{attrs:{to:"/"}},[n("el-dropdown-item",[e._v("首页")])],1),e._v(" "),n("router-link",{attrs:{to:"/security/change-password"}},[n("el-dropdown-item",[e._v("修改密码")])],1),e._v(" "),n("a",{attrs:{target:"_blank",href:"https://github.com/jwma/jump-jump"}},[n("el-dropdown-item",[e._v("Github")])],1),e._v(" "),n("el-dropdown-item",{attrs:{divided:""},nativeOn:{click:function(t){return e.logout(t)}}},[n("span",{staticStyle:{display:"block"}},[e._v("登出")])])],1)],1)],1)],1)},d=[],l=(n("96cf"),n("3b8d")),f=n("db72"),h=n("2f62"),b=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)},m=[],p=(n("7f7f"),n("bd11")),v=n.n(p),g={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=v.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))}}},j=g,w=(n("34c8"),n("2877")),k=Object(w["a"])(j,b,m,!1,null,"62cc9144",null),y=k.exports,x=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"}})])])},_=[],C={name:"Hamburger",props:{isActive:{type:Boolean,default:!1}},methods:{toggleClick:function(){this.$emit("toggleClick")}}},z=C,O=(n("186a"),Object(w["a"])(z,x,_,!1,null,"49e15297",null)),S=O.exports,E={components:{Breadcrumb:y,Hamburger:S},computed:Object(f["a"])({},Object(h["b"])(["sidebar","name"])),methods:{toggleSideBar:function(){this.$store.dispatch("app/toggleSideBar")},logout:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.$store.dispatch("user/logout");case 2:this.$router.push("/login?redirect=".concat(this.$route.fullPath));case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}},M=E,B=(n("9f43"),Object(w["a"])(M,u,d,!1,null,"26745010",null)),T=B.exports,L=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)},$=[],A=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)},H=[],D={name:"SidebarLogo",props:{collapse:{type:Boolean,required:!0}},data:function(){return{title:"Vue Admin Template",logo:"https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png"}}},P=D,I=(n("6b31"),Object(w["a"])(P,A,H,!1,null,"5bb1c0e2",null)),N=I.exports,q=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.item.hidden?e._e():n("div",[!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)},R=[],G=n("df7c"),V=n.n(G),F=n("61f7"),U={name:"MenuItem",functional:!0,props:{icon:{type:String,default:""},title:{type:String,default:""}},render:function(e,t){var n=t.props,a=n.icon,s=n.title,i=[];return a&&i.push(e("svg-icon",{attrs:{"icon-class":a}})),s&&i.push(e("span",{slot:"title"},[s])),i}},J=U,Y=Object(w["a"])(J,a,s,!1,null,null,null),K=Y.exports,W=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)},Q=[],X={props:{to:{type:String,required:!0}},methods:{linkProps:function(e){return Object(F["a"])(e)?{is:"a",href:e,target:"_blank",rel:"noopener"}:{is:"router-link",to:e}}}},Z=X,ee=Object(w["a"])(Z,W,Q,!1,null,null,null),te=ee.exports,ne={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)}}}}},ae={name:"SidebarItem",components:{Item:K,AppLink:te},mixins:[ne],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(f["a"])({},n,{path:"",noShowingChildren:!0}),!0)},resolvePath:function(e){return Object(F["a"])(e)?e:Object(F["a"])(this.basePath)?this.basePath:V.a.resolve(this.basePath,e)}}},se=ae,ie=Object(w["a"])(se,q,R,!1,null,null,null),re=ie.exports,oe=n("cf1e2"),ce=n.n(oe),ue={components:{SidebarItem:re,Logo:N},computed:Object(f["a"])({},Object(h["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 ce.a},isCollapse:function(){return!this.sidebar.opened}})},de=ue,le=Object(w["a"])(de,L,$,!1,null,null,null),fe=le.exports,he=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)},be=[],me={name:"AppMain",computed:{key:function(){return this.$route.path}}},pe=me,ve=(n("e4de"),n("028b"),Object(w["a"])(pe,he,be,!1,null,"64cf4d83",null)),ge=ve.exports,je=n("4360"),we=document,ke=we.body,ye=992,xe={watch:{$route:function(e){"mobile"===this.device&&this.sidebar.opened&&je["a"].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&&(je["a"].dispatch("app/toggleDevice","mobile"),je["a"].dispatch("app/closeSideBar",{withoutAnimation:!0}))},methods:{$_isMobile:function(){var e=ke.getBoundingClientRect();return e.width-1'});r.a.add(o);t["default"]=o},b775:function(e,t,n){"use strict";var a=n("bc3a"),s=n.n(a),i=n("5c96"),r=n("4360"),o=n("5f87"),c=s.a.create({baseURL:"",timeout:5e3});c.interceptors.request.use((function(e){return r["a"].getters.token&&(e.headers["Authorization"]="Bearer "+Object(o["a"])()),e}),(function(e){return console.log(e),Promise.reject(e)})),c.interceptors.response.use((function(e){var t=e.data;return 4999===t.code?(Object(i["Message"])({message:t.msg||"Error",type:"error",duration:5e3}),Promise.reject(new Error(t.message||"Error"))):t}),(function(e){var t=e.response;return 401===t.status?i["MessageBox"].confirm("你的登入已过期,请重新登入","登入过期",{confirmButtonText:"重新登入",cancelButtonText:"取消",type:"warning"}).then((function(){r["a"].dispatch("user/resetToken").then((function(){location.reload()}))})):500===t.status&&Object(i["Message"])({message:"服务器繁忙,请稍后再试...",type:"error",duration:5e3}),Promise.reject(e)})),t["a"]=c},bf90:function(e,t,n){},c24f:function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"a",(function(){return o}));var a=n("b775");function s(e){return Object(a["a"])({url:"/v1/user/login",method:"post",data:e})}function i(){return Object(a["a"])({url:"/v1/user/info",method:"get"})}function r(){return Object(a["a"])({url:"/v1/user/logout",method:"post"})}function o(e){return Object(a["a"])({url:"/v1/user/change-password",method:"patch",data:e})}},c2a3:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-add",use:"icon-add-usage",viewBox:"0 0 1026 1024",content:''});r.a.add(o);t["default"]=o},cf1e2:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409EFF",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},d1a7:function(e,t,n){"use strict";var a=n("031b"),s=n.n(a);s.a},d7ec:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-eye-open",use:"icon-eye-open-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},dc52:function(e,t,n){},e4de:function(e,t,n){"use strict";var a=n("8902"),s=n.n(a);s.a},eb1b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});r.a.add(o);t["default"]=o},f12c:function(e,t,n){},f782:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-dashboard",use:"icon-dashboard-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o}},[[0,"runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file diff --git a/web/admin/static/js/app.3ef36a39.js b/web/admin/static/js/app.3ef36a39.js deleted file mode 100644 index 013faf3..0000000 --- a/web/admin/static/js/app.3ef36a39.js +++ /dev/null @@ -1 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app"],{0:function(e,t,n){e.exports=n("56d7")},"028b":function(e,t,n){"use strict";var a=n("f12c"),s=n.n(a);s.a},"031b":function(e,t,n){},"186a":function(e,t,n){"use strict";var a=n("dc52"),s=n.n(a);s.a},"18f0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},2995:function(e,t,n){},"2a3d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});r.a.add(o);t["default"]=o},3289:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-list",use:"icon-list-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},"34c8":function(e,t,n){"use strict";var a=n("88a1"),s=n.n(a);s.a},4360:function(e,t,n){"use strict";var a=n("2b0e"),s=n("2f62"),i=(n("7f7f"),{sidebar:function(e){return e.app.sidebar},device:function(e){return e.app.device},token:function(e){return e.user.token},name:function(e){return e.user.name},role:function(e){return e.user.role}}),r=i,o=n("a78e"),c=n.n(o),u={sidebar:{opened:!c.a.get("sidebarStatus")||!!+c.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop"},d={TOGGLE_SIDEBAR:function(e){e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1,e.sidebar.opened?c.a.set("sidebarStatus",1):c.a.set("sidebarStatus",0)},CLOSE_SIDEBAR:function(e,t){c.a.set("sidebarStatus",0),e.sidebar.opened=!1,e.sidebar.withoutAnimation=t},TOGGLE_DEVICE:function(e,t){e.device=t}},l={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)}},f={namespaced:!0,state:u,mutations:d,actions:l},h=n("83d6"),b=n.n(h),m=b.a.showSettings,p=b.a.fixedHeader,v=b.a.sidebarLogo,g={showSettings:m,fixedHeader:p,sidebarLogo:v},j={CHANGE_SETTING:function(e,t){var n=t.key,a=t.value;e.hasOwnProperty(n)&&(e[n]=a)}},w={changeSetting:function(e,t){var n=e.commit;n("CHANGE_SETTING",t)}},k={namespaced:!0,state:g,mutations:j,actions:w},y=n("c24f"),x=n("5f87"),_=n("a18c"),C=function(){return{token:Object(x["a"])(),name:"",role:1}},z=C(),O={RESET_STATE:function(e){Object.assign(e,C())},SET_TOKEN:function(e,t){e.token=t},SET_NAME:function(e,t){e.name=t},SET_ROLE:function(e,t){e.role=t}},S={login:function(e,t){var n=e.commit,a=t.username,s=t.password;return new Promise((function(e,t){Object(y["c"])({username:a.trim(),password:s}).then((function(t){var a=t.data;n("SET_TOKEN",a.token),Object(x["c"])(a.token),e()})).catch((function(e){t(e)}))}))},getInfo:function(e){var t=e.commit;e.state;return new Promise((function(e,n){Object(y["b"])().then((function(a){var s=a.data;s||n("登入信息验证失败,请重新登入");var i=s.username,r=s.role;t("SET_NAME",i),t("SET_ROLE",r),e(s)})).catch((function(e){n(e)}))}))},logout:function(e){var t=e.commit,n=e.state;return new Promise((function(e,a){Object(y["d"])(n.token).then((function(){Object(x["b"])(),Object(_["b"])(),t("RESET_STATE"),e()})).catch((function(e){a(e)}))}))},resetToken:function(e){var t=e.commit;return new Promise((function(e){Object(x["b"])(),t("RESET_STATE"),e()}))}},E={namespaced:!0,state:z,mutations:O,actions:S};a["default"].use(s["a"]);var M=new s["a"].Store({modules:{app:f,settings:k,user:E},getters:r});t["a"]=M},4678:function(e,t,n){var a={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-SG":"cdab","./en-SG.js":"cdab","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-nz":"6f50","./en-nz.js":"6f50","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-tw":"90ea","./zh-tw.js":"90ea"};function s(e){var t=i(e);return n(t)}function i(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}s.keys=function(){return Object.keys(a)},s.resolve=i,e.exports=s,s.id="4678"},"4cdc":function(e,t,n){},"4df5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});r.a.add(o);t["default"]=o},"51ff":function(e,t,n){var a={"./add.svg":"c2a3","./dashboard.svg":"f782","./eye-open.svg":"d7ec","./eye.svg":"4df5","./form.svg":"eb1b","./github.svg":"558d","./link.svg":"18f0","./list.svg":"3289","./password.svg":"2a3d","./user.svg":"b3b5"};function s(e){var t=i(e);return n(t)}function i(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}s.keys=function(){return Object.keys(a)},s.resolve=i,e.exports=s,s.id="51ff"},"558d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-github",use:"icon-github-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var a=n("2b0e"),s=n("c1df"),i=n.n(s),r=(n("f5df"),n("5c96")),o=n.n(r),c=(n("0fae"),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=[],d={name:"App"},l=d,f=n("2877"),h=Object(f["a"])(l,c,u,!1,null,null,null),b=h.exports,m=n("4360"),p=n("a18c"),v=(n("ac6a"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isExternal?n("div",e._g({staticClass:"svg-external-icon svg-icon",style:e.styleExternalIcon},e.$listeners)):n("svg",e._g({class:e.svgClass,attrs:{"aria-hidden":"true"}},e.$listeners),[n("use",{attrs:{href:e.iconName}})])}),g=[],j=n("61f7"),w={name:"SvgIcon",props:{iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{isExternal:function(){return Object(j["a"])(this.iconClass)},iconName:function(){return"#icon-".concat(this.iconClass)},svgClass:function(){return this.className?"svg-icon "+this.className:"svg-icon"},styleExternalIcon:function(){return{mask:"url(".concat(this.iconClass,") no-repeat 50% 50%"),"-webkit-mask":"url(".concat(this.iconClass,") no-repeat 50% 50%")}}}},k=w,y=(n("d1a7"),Object(f["a"])(k,v,g,!1,null,"4342976c",null)),x=y.exports;a["default"].component("svg-icon",x);var _=n("51ff"),C=function(e){return e.keys().map(e)};C(_);n("7f7f"),n("96cf");var z=n("3b8d"),O=n("323e"),S=n.n(O),E=(n("a5d8"),n("5f87")),M=n("83d6"),B=n.n(M),T=B.a.title||"Vue Admin Template";function L(e){return e?"".concat(e," - ").concat(T):"".concat(T)}S.a.configure({showSpinner:!1});var $=["/login"];p["a"].beforeEach(function(){var e=Object(z["a"])(regeneratorRuntime.mark((function e(t,n,a){var s,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(S.a.start(),document.title=L(t.meta.title),s=Object(E["a"])(),!s){e.next=29;break}if("/login"!==t.path){e.next=9;break}a({path:"/"}),S.a.done(),e.next=27;break;case 9:if(i=m["a"].getters.name,!i){e.next=14;break}a(),e.next=27;break;case 14:return e.prev=14,e.next=17,m["a"].dispatch("user/getInfo");case 17:a(),e.next=27;break;case 20:return e.prev=20,e.t0=e["catch"](14),e.next=24,m["a"].dispatch("user/resetToken");case 24:r["Message"].error(e.t0||"Has Error"),a("/login?redirect=".concat(t.path)),S.a.done();case 27:e.next=30;break;case 29:-1!==$.indexOf(t.path)?a():(a("/login?redirect=".concat(t.path)),S.a.done());case 30:case"end":return e.stop()}}),e,null,[[14,20]])})));return function(t,n,a){return e.apply(this,arguments)}}()),p["a"].afterEach((function(){S.a.done()})),a["default"].filter("dateformat",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD HH:mm:ss";return e?i()(e).format(t):"-"})),a["default"].use(o.a),a["default"].config.productionTip=!1,new a["default"]({el:"#app",router:p["a"],store:m["a"],render:function(e){return e(b)}})},"5f87":function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return c}));var a=n("a78e"),s=n.n(a),i="j2_token";function r(){return s.a.get(i)}function o(e){return s.a.set(i,e)}function c(){return s.a.remove(i)}},"61f7":function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return r}));n("3b2b");function a(e){return/^(https?:|mailto:|tel:)/.test(e)}function s(e){return e.length>=2}var i=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|localhost|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\#[-a-z\\d_\\/]*)?(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");function r(e){return!!i.test(e)}},"6b31":function(e,t,n){"use strict";var a=n("4cdc"),s=n.n(a);s.a},"83d6":function(e,t){e.exports={title:"Jump Jump Admin",fixedHeader:!1,sidebarLogo:!1}},"88a1":function(e,t,n){},8902:function(e,t,n){},"9f2b":function(e,t,n){"use strict";var a=n("bf90"),s=n.n(a);s.a},"9f43":function(e,t,n){"use strict";var a=n("2995"),s=n.n(a);s.a},a18c:function(e,t,n){"use strict";var a,s,i=n("2b0e"),r=n("8c4f"),o=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)},c=[],u=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-dropdown",{staticClass:"username-container",attrs:{trigger:"click"}},[n("div",{staticClass:"username-wrapper"},[n("span",{staticStyle:{cursor:"pointer"}},[e._v(e._s(e.name))])]),e._v(" "),n("el-dropdown-menu",{staticClass:"user-dropdown",attrs:{slot:"dropdown"},slot:"dropdown"},[n("router-link",{attrs:{to:"/"}},[n("el-dropdown-item",[e._v("首页")])],1),e._v(" "),n("router-link",{attrs:{to:"/security/change-password"}},[n("el-dropdown-item",[e._v("修改密码")])],1),e._v(" "),n("a",{attrs:{target:"_blank",href:"https://github.com/jwma/jump-jump"}},[n("el-dropdown-item",[e._v("Github")])],1),e._v(" "),n("el-dropdown-item",{attrs:{divided:""},nativeOn:{click:function(t){return e.logout(t)}}},[n("span",{staticStyle:{display:"block"}},[e._v("登出")])])],1)],1)],1)],1)},d=[],l=(n("96cf"),n("3b8d")),f=n("db72"),h=n("2f62"),b=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)},m=[],p=(n("7f7f"),n("bd11")),v=n.n(p),g={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=v.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))}}},j=g,w=(n("34c8"),n("2877")),k=Object(w["a"])(j,b,m,!1,null,"62cc9144",null),y=k.exports,x=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"}})])])},_=[],C={name:"Hamburger",props:{isActive:{type:Boolean,default:!1}},methods:{toggleClick:function(){this.$emit("toggleClick")}}},z=C,O=(n("186a"),Object(w["a"])(z,x,_,!1,null,"49e15297",null)),S=O.exports,E={components:{Breadcrumb:y,Hamburger:S},computed:Object(f["a"])({},Object(h["b"])(["sidebar","name"])),methods:{toggleSideBar:function(){this.$store.dispatch("app/toggleSideBar")},logout:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.$store.dispatch("user/logout");case 2:this.$router.push("/login?redirect=".concat(this.$route.fullPath));case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}},M=E,B=(n("9f43"),Object(w["a"])(M,u,d,!1,null,"26745010",null)),T=B.exports,L=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)},$=[],A=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)},H=[],D={name:"SidebarLogo",props:{collapse:{type:Boolean,required:!0}},data:function(){return{title:"Vue Admin Template",logo:"https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png"}}},P=D,I=(n("6b31"),Object(w["a"])(P,A,H,!1,null,"5bb1c0e2",null)),N=I.exports,q=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.item.hidden?e._e():n("div",[!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)},R=[],G=n("df7c"),V=n.n(G),F=n("61f7"),U={name:"MenuItem",functional:!0,props:{icon:{type:String,default:""},title:{type:String,default:""}},render:function(e,t){var n=t.props,a=n.icon,s=n.title,i=[];return a&&i.push(e("svg-icon",{attrs:{"icon-class":a}})),s&&i.push(e("span",{slot:"title"},[s])),i}},J=U,Y=Object(w["a"])(J,a,s,!1,null,null,null),K=Y.exports,W=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)},Q=[],X={props:{to:{type:String,required:!0}},methods:{linkProps:function(e){return Object(F["a"])(e)?{is:"a",href:e,target:"_blank",rel:"noopener"}:{is:"router-link",to:e}}}},Z=X,ee=Object(w["a"])(Z,W,Q,!1,null,null,null),te=ee.exports,ne={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)}}}}},ae={name:"SidebarItem",components:{Item:K,AppLink:te},mixins:[ne],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(f["a"])({},n,{path:"",noShowingChildren:!0}),!0)},resolvePath:function(e){return Object(F["a"])(e)?e:Object(F["a"])(this.basePath)?this.basePath:V.a.resolve(this.basePath,e)}}},se=ae,ie=Object(w["a"])(se,q,R,!1,null,null,null),re=ie.exports,oe=n("cf1e2"),ce=n.n(oe),ue={components:{SidebarItem:re,Logo:N},computed:Object(f["a"])({},Object(h["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 ce.a},isCollapse:function(){return!this.sidebar.opened}})},de=ue,le=Object(w["a"])(de,L,$,!1,null,null,null),fe=le.exports,he=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)},be=[],me={name:"AppMain",computed:{key:function(){return this.$route.path}}},pe=me,ve=(n("e4de"),n("028b"),Object(w["a"])(pe,he,be,!1,null,"64cf4d83",null)),ge=ve.exports,je=n("4360"),we=document,ke=we.body,ye=992,xe={watch:{$route:function(e){"mobile"===this.device&&this.sidebar.opened&&je["a"].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&&(je["a"].dispatch("app/toggleDevice","mobile"),je["a"].dispatch("app/closeSideBar",{withoutAnimation:!0}))},methods:{$_isMobile:function(){var e=ke.getBoundingClientRect();return e.width-1'});r.a.add(o);t["default"]=o},b775:function(e,t,n){"use strict";var a=n("bc3a"),s=n.n(a),i=n("5c96"),r=n("4360"),o=n("5f87"),c=s.a.create({baseURL:"",timeout:5e3});c.interceptors.request.use((function(e){return r["a"].getters.token&&(e.headers["Authorization"]="Bearer "+Object(o["a"])()),e}),(function(e){return console.log(e),Promise.reject(e)})),c.interceptors.response.use((function(e){var t=e.data;return 4999===t.code?(Object(i["Message"])({message:t.msg||"Error",type:"error",duration:5e3}),Promise.reject(new Error(t.message||"Error"))):t}),(function(e){var t=e.response;return 401===t.status?i["MessageBox"].confirm("你的登入已过期,请重新登入","登入过期",{confirmButtonText:"重新登入",cancelButtonText:"取消",type:"warning"}).then((function(){r["a"].dispatch("user/resetToken").then((function(){location.reload()}))})):500===t.status&&Object(i["Message"])({message:"服务器繁忙,请稍后再试...",type:"error",duration:5e3}),Promise.reject(e)})),t["a"]=c},bf90:function(e,t,n){},c24f:function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"a",(function(){return o}));var a=n("b775");function s(e){return Object(a["a"])({url:"/v1/user/login",method:"post",data:e})}function i(){return Object(a["a"])({url:"/v1/user/info",method:"get"})}function r(){return Object(a["a"])({url:"/v1/user/logout",method:"post"})}function o(e){return Object(a["a"])({url:"/v1/user/change-password",method:"patch",data:e})}},c2a3:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-add",use:"icon-add-usage",viewBox:"0 0 1026 1024",content:''});r.a.add(o);t["default"]=o},cf1e2:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409EFF",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},d1a7:function(e,t,n){"use strict";var a=n("031b"),s=n.n(a);s.a},d7ec:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-eye-open",use:"icon-eye-open-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o},dc52:function(e,t,n){},e4de:function(e,t,n){"use strict";var a=n("8902"),s=n.n(a);s.a},eb1b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});r.a.add(o);t["default"]=o},f12c:function(e,t,n){},f782:function(e,t,n){"use strict";n.r(t);var a=n("e017"),s=n.n(a),i=n("21a1"),r=n.n(i),o=new s.a({id:"icon-dashboard",use:"icon-dashboard-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(o);t["default"]=o}},[[0,"runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file diff --git a/web/admin/static/js/chunk-0cef0a8e.f9636132.js b/web/admin/static/js/chunk-0cef0a8e.f9636132.js deleted file mode 100644 index e7f5f9d..0000000 --- a/web/admin/static/js/chunk-0cef0a8e.f9636132.js +++ /dev/null @@ -1,8 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0cef0a8e"],{6849:function(e,t,r){},9472:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-main",[r("el-drawer",{ref:"createFormDrawer",attrs:{visible:e.createFormDrawer,direction:"rtl","before-close":e.handleCreateFormDrawerClose},on:{"update:visible":function(t){e.createFormDrawer=t}}},[r("div",{staticStyle:{width:"90%","margin-left":"15px"}},[r("h2",{staticStyle:{"margin-top":"0",color:"#606266"}},[e._v("添加短链接")]),e._v(" "),r("el-form",{ref:"createForm",attrs:{model:e.createForm,rules:e.createFormRules}},[r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:2===e.role,expression:"role === 2"}],attrs:{label:"指定 ID",prop:"id"}},[r("el-switch",{on:{change:function(t){return e.specifyIdChange(t)}},model:{value:e.createForm.specifyId,callback:function(t){e.$set(e.createForm,"specifyId",t)},expression:"createForm.specifyId"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("设置你期望的ID,设置后随机ID将不起作用。")]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})]),e._v(" "),r("el-input",{directives:[{name:"show",rawName:"v-show",value:e.createForm.specifyId,expression:"createForm.specifyId"}],attrs:{disabled:e.createForm.setIdLength,placeholder:"示例:home"},model:{value:e.createForm.id,callback:function(t){e.$set(e.createForm,"id",t)},expression:"createForm.id"}})],1),e._v(" "),r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:2===e.role,expression:"role === 2"}],attrs:{label:"指定随机 ID 长度",prop:"id_length"}},[r("el-switch",{on:{change:function(t){return e.setIdLengthChange(t)}},model:{value:e.createForm.setIdLength,callback:function(t){e.$set(e.createForm,"setIdLength",t)},expression:"createForm.setIdLength"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("在允许的范围内指定随机ID的长度,不指定时会使用系统默认设置。")]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})]),e._v(" "),r("el-slider",{directives:[{name:"show",rawName:"v-show",value:e.createForm.setIdLength,expression:"createForm.setIdLength"}],attrs:{"show-input":"",disabled:e.createForm.specifyId,min:e.idConfig.idMinimumLength,max:e.idConfig.idMaximumLength},model:{value:e.createForm.id_length,callback:function(t){e.$set(e.createForm,"id_length",t)},expression:"createForm.id_length"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"目标链接",prop:"url"}},[r("el-input",{attrs:{placeholder:"示例:https://github.com/jwma/jump-jump"},model:{value:e.createForm.url,callback:function(t){e.$set(e.createForm,"url",t)},expression:"createForm.url"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"描述",prop:"description"}},[r("el-input",{attrs:{type:"textarea",placeholder:"示例:某某帖子使用"},model:{value:e.createForm.description,callback:function(t){e.$set(e.createForm,"description",t)},expression:"createForm.description"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"启用?",prop:"is_enable"}},[r("el-switch",{model:{value:e.createForm.is_enable,callback:function(t){e.$set(e.createForm,"is_enable",t)},expression:"createForm.is_enable"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("开启后短链接可以正常被访问,关闭后短链接被访问时会告知用户访问的页面不存在。"),r("br"),e._v(" "),r("strong",[e._v("注意:关闭后不会统计短链接访问的数据。")])]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})])],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.onCreateFormSubmit}},[e._v("添加")]),e._v(" "),r("el-button",{attrs:{size:"mini"},on:{click:e.onCreateFormCancel}},[e._v("取消")])],1)],1)],1)]),e._v(" "),r("el-drawer",{ref:"editFormDrawer",attrs:{visible:e.editFormDrawer,direction:"rtl","before-close":e.handleEditFormDrawerClose},on:{"update:visible":function(t){e.editFormDrawer=t}}},[r("div",{staticStyle:{width:"90%","margin-left":"15px"}},[r("h2",{staticStyle:{"margin-top":"0",color:"#606266"}},[e._v("更新:"+e._s(e.editForm.id))]),e._v(" "),r("el-form",{ref:"editForm",attrs:{model:e.editForm,rules:e.editFormRules}},[r("el-form-item",{attrs:{label:"目标链接",prop:"url"}},[r("el-input",{attrs:{placeholder:"示例:https://github.com/jwma/jump-jump"},model:{value:e.editForm.url,callback:function(t){e.$set(e.editForm,"url",t)},expression:"editForm.url"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"描述",prop:"description"}},[r("el-input",{attrs:{type:"textarea",placeholder:"示例:某某帖子使用"},model:{value:e.editForm.description,callback:function(t){e.$set(e.editForm,"description",t)},expression:"editForm.description"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"启用?",prop:"is_enable"}},[r("el-switch",{model:{value:e.editForm.is_enable,callback:function(t){e.$set(e.editForm,"is_enable",t)},expression:"editForm.is_enable"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("开启后短链接可以正常被访问,关闭后短链接被访问时会告知用户访问的页面不存在。"),r("br"),e._v(" "),r("strong",[e._v("注意:关闭后不会统计短链接访问的数据。")])]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})])],1),e._v(" "),r("el-form-item",{attrs:{label:"创建人"}},[r("span",{staticStyle:{color:"#909399"}},[e._v(e._s(e.editForm.created_by))])]),e._v(" "),r("el-form-item",{attrs:{label:"添加时间"}},[r("span",{staticStyle:{color:"#909399"}},[e._v(e._s(e._f("dateformat")(e.editForm.create_time)))])]),e._v(" "),r("el-form-item",{attrs:{label:"更新时间"}},[r("span",{staticStyle:{color:"#909399"}},[e._v(e._s(e._f("dateformat")(e.editForm.update_time)))])]),e._v(" "),r("el-form-item",[r("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.onEditFormSubmit}},[e._v("更新")]),e._v(" "),r("el-button",{attrs:{size:"mini"},on:{click:e.onEditFormCancel}},[e._v("取消")])],1)],1)],1)]),e._v(" "),r("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:function(t){return e.getList(1)}}},[e._v("刷新")]),e._v(" "),r("el-button",{attrs:{icon:"el-icon-plus",size:"mini",type:"primary"},on:{click:function(t){return e.toCreate()}}},[e._v("添加\n ")]),e._v(" "),r("el-table",{staticStyle:{width:"100%"},attrs:{data:e.list,"max-height":"800",fit:""}},[r("el-table-column",{attrs:{label:"短链接",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-dropdown",{attrs:{size:"small"}},[r("span",{staticClass:"el-dropdown-link"},[e._v("\n "+e._s(t.row.id)),r("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),r("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.landingHosts,(function(n){return r("el-dropdown-item",[r("span",{on:{click:function(r){return e.copyShortLink(n+t.row.id,r)}}},[e._v(e._s(n+t.row.id))])])})),1)],1)]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"url",label:"目标链接",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-link",{attrs:{type:"info",href:t.row.url,target:"_blank"}},[e._v(e._s(t.row.url))])]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"描述",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.description?t.row.description:"-")+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"启用?",width:"70",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("i",{class:{"el-icon-check":e.row.is_enable,"el-icon-close":!e.row.is_enable}})]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"创建人",width:"150",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.created_by)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"添加时间",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("dateformat")(t.row.create_time,"DD/MM/YY"))+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"更新时间",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("dateformat")(t.row.update_time,"DD/MM/YY"))+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{attrs:{size:"mini",circle:"",icon:"el-icon-s-data"},on:{click:function(r){return e.goto({name:"ShortLinkData",params:{id:t.row.id}})}}}),e._v(" "),r("el-button",{attrs:{size:"mini",circle:"",icon:"el-icon-edit-outline"},on:{click:function(r){return e.toEdit(t.row.id)}}}),e._v(" "),r("el-button",{attrs:{type:"danger",size:"mini",icon:"el-icon-delete-solid",circle:""},on:{click:function(r){return e.deleteShortLink(t.row.id)}}})]}}])})],1),e._v(" "),r("div",{staticClass:"paginator-container"},[r("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total,"hide-on-single-page":!0},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleCurrentPageChange}})],1)],1)},o=[],i=r("db72"),a=r("bfad"),c=r("da71"),s=r("61f7"),l=r("2b0e"),u=r("b311"),d=r.n(u);function f(){l["default"].prototype.$message({message:"复制成功",type:"success",duration:1500})}function m(){l["default"].prototype.$message({message:"复制失败",type:"error"})}function h(e,t){var r=new d.a(t.target,{text:function(){return e}});r.on("success",(function(){f(),r.off("error"),r.off("success"),r.destroy()})),r.on("error",(function(){m(),r.off("error"),r.off("success"),r.destroy()})),r.onClick(t)}var p=r("2f62"),g={name:"ShortLinkList",data:function(){var e=function(e,t,r){if(""===t)r(new Error("请输入目标链接"));else{if(!Object(s["b"])(t))return void r(new Error("这不是一个合法的目标链接"));r()}};return{landingHosts:[],list:[],total:0,currentPage:1,pageSize:20,createFormDrawer:!1,idConfig:{idMinimumLength:0,idLength:0,idMaximumLength:0},createForm:{specifyId:!1,setIdLength:!1,id:"",url:"",description:"",is_enable:!1,id_length:0},createFormRules:{url:[{required:!0,validator:e,trigger:"blur"}]},editFormDrawer:!1,editForm:{id:"",url:"",description:"",is_enable:!1,created_by:"",create_time:"",update_time:""},editFormRules:{url:[{validator:e,trigger:"blur"}]}}},created:function(){var e=this;Object(c["a"])().then((function(t){e.landingHosts=t.data.config.landingHosts,e.idConfig=t.data.config.idConfig,e.createForm.id_length=e.idConfig.idLength,e.getList(e.currentPage)}))},computed:Object(i["a"])({},Object(p["b"])(["role"])),methods:{goto:function(e){this.$router.push(e)},copyShortLink:function(e,t){h(e,t)},getList:function(e){var t=this;Object(a["c"])(e,this.pageSize).then((function(r){t.currentPage=e,t.total=r.data.total,t.list=r.data.shortLinks,1!==t.currentPage&&0===t.list.length&&t.total>0&&(t.currentPage=1,t.getList(1))}))},resetCreateForm:function(){this.createForm.specifyId=!1,this.createForm.setIdLength=!1,this.createForm.id="",this.createForm.url="",this.createForm.description="",this.createForm.is_enable=!1},resetEditForm:function(){this.editForm.url="",this.editForm.description="",this.editForm.is_enable=!1,this.editForm.created_by="",this.editForm.create_time="",this.editForm.update_time=""},handlePageSizeChange:function(e){this.pageSize=e,this.currentPage=1,this.getList(1)},handleCurrentPageChange:function(e){this.currentPage=e,this.getList(e)},toCreate:function(){var e=this;Object(c["a"])().then((function(t){e.idConfig=t.data.config.idConfig,e.createForm.id_length=e.idConfig.idLength,e.createFormDrawer=!0}))},handleCreateFormDrawerClose:function(e){this.resetCreateForm(),e()},onCreateFormSubmit:function(){var e=this;this.$refs.createForm.validate((function(t){if(!t)return!1;Object(a["a"])(e.createForm).then((function(t){e.$refs.createFormDrawer.closeDrawer(),e.$notify({title:"添加短链接成功",message:"ID:"+t.data.shortLink.id,type:"success"}),e.getList(e.currentPage)}))}))},onCreateFormCancel:function(){this.resetCreateForm(),this.createFormDrawer=!1},toEdit:function(e){var t=this;Object(a["d"])(e).then((function(e){t.editFormDrawer=!0,t.editForm=e.data.shortLink}))},handleEditFormDrawerClose:function(e){this.resetEditForm(),e()},onEditFormSubmit:function(){var e=this;this.$refs.editForm.validate((function(t){if(!t)return!1;Object(a["g"])(e.editForm.id,e.editForm).then((function(t){e.$refs.editFormDrawer.closeDrawer(),e.$notify({title:"更新成功",message:"ID:"+t.data.shortLink.id,type:"success"}),e.getList(e.currentPage)}))}))},onEditFormCancel:function(){this.resetEditForm(),this.editFormDrawer=!1},deleteShortLink:function(e){var t=this;this.$confirm("此操作会永久删除短链接,是否继续?","删除确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(a["f"])(e).then((function(r){t.$notify({title:"成功删除短链接",message:"ID:".concat(e),type:"success"}),t.getList(t.currentPage)}))}))},specifyIdChange:function(e){e?(this.createForm.setIdLength=!1,this.setIdLengthChange(!1)):this.createForm.id=""},setIdLengthChange:function(e){e?(this.createForm.specifyId=!1,this.specifyIdChange(!1)):this.createForm.id_length=this.idConfig.idLength}}},v=g,b=(r("aeff"),r("2877")),y=Object(b["a"])(v,n,o,!1,null,"11546d78",null);t["default"]=y.exports},aeff:function(e,t,r){"use strict";var n=r("6849"),o=r.n(n);o.a},b311:function(e,t,r){ -/*! - * clipboard.js v2.0.6 - * https://clipboardjs.com/ - * - * Licensed MIT © Zeno Rocha - */ -(function(t,r){e.exports=r()})(0,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t){function r(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var r=e.hasAttribute("readonly");r||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),r||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var n=window.getSelection(),o=document.createRange();o.selectNodeContents(e),n.removeAllRanges(),n.addRange(o),t=n.toString()}return t}e.exports=r},function(e,t){function r(){}r.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function o(){n.off(e,o),t.apply(r,arguments)}return o._=t,this.on(e,o,r)},emit:function(e){var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,o=r.length;for(n;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=r+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=o()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=o()(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==("undefined"===typeof e?"undefined":i(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}(),l=s,u=r(1),d=r.n(u),f=r(2),m=r.n(f),h="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"===typeof e.action?e.action:this.defaultAction,this.target="function"===typeof e.target?e.target:this.defaultTarget,this.text="function"===typeof e.text?e.text:this.defaultText,this.container="object"===h(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=m()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return _("action",e)}},{key:"defaultTarget",value:function(e){var t=_("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return _("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"===typeof e?[e]:e,r=!!document.queryCommandSupported;return t.forEach((function(e){r=r&&!!document.queryCommandSupported(e)})),r}}]),t}(d.a);function _(e,t){var r="data-clipboard-"+e;if(t.hasAttribute(r))return t.getAttribute(r)}t["default"]=y}])["default"]}))},bfad:function(e,t,r){"use strict";r.d(t,"d",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return a})),r.d(t,"f",(function(){return c})),r.d(t,"g",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"e",(function(){return u}));var n=r("b775");function o(e){return Object(n["a"])({url:"/v1/short-link/".concat(e),method:"get"})}function i(e,t){return Object(n["a"])({url:"/v1/short-link/?page=".concat(e,"&pageSize=").concat(t),method:"get"})}function a(e){return Object(n["a"])({url:"/v1/short-link/",method:"post",data:e})}function c(e){return Object(n["a"])({url:"/v1/short-link/".concat(e),method:"delete"})}function s(e,t){return Object(n["a"])({url:"/v1/short-link/".concat(e),method:"patch",data:t})}function l(e,t){return Object(n["a"])({url:"/v1/short-link/".concat(e,"/latest-request-history?size=").concat(t),method:"get"})}function u(e,t,r){return Object(n["a"])({url:"/v1/short-link/".concat(e,"/data?startDate=").concat(t,"&endDate=").concat(r),method:"get"})}},da71:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return a})),r.d(t,"d",(function(){return c}));var n=r("b775");function o(){return Object(n["a"])({url:"/v1/config",method:"get"})}function i(e){return Object(n["a"])({url:"/v1/config/landing-hosts",method:"patch",data:e})}function a(e){return Object(n["a"])({url:"/v1/config/id-length",method:"patch",data:e})}function c(e){return Object(n["a"])({url:"/v1/config/short-link-404-handling",method:"patch",data:e})}}}]); \ No newline at end of file diff --git a/web/admin/static/js/chunk-36236bc7.3eda432a.js b/web/admin/static/js/chunk-36236bc7.3eda432a.js new file mode 100644 index 0000000..7c2c847 --- /dev/null +++ b/web/admin/static/js/chunk-36236bc7.3eda432a.js @@ -0,0 +1,8 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-36236bc7"],{"66cd":function(e,t,r){"use strict";var n=r("a9af"),o=r.n(n);o.a},9472:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-main",[r("el-drawer",{ref:"createFormDrawer",attrs:{visible:e.createFormDrawer,direction:"rtl","before-close":e.handleCreateFormDrawerClose},on:{"update:visible":function(t){e.createFormDrawer=t}}},[r("div",{staticStyle:{width:"90%","margin-left":"15px"}},[r("h2",{staticStyle:{"margin-top":"0",color:"#606266"}},[e._v("添加短链接")]),e._v(" "),r("el-form",{ref:"createForm",attrs:{model:e.createForm,rules:e.createFormRules}},[r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:2===e.role,expression:"role === 2"}],attrs:{label:"指定 ID",prop:"id"}},[r("el-switch",{on:{change:function(t){return e.specifyIdChange(t)}},model:{value:e.createForm.specifyId,callback:function(t){e.$set(e.createForm,"specifyId",t)},expression:"createForm.specifyId"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("设置你期望的ID,设置后随机ID将不起作用。")]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})]),e._v(" "),r("el-input",{directives:[{name:"show",rawName:"v-show",value:e.createForm.specifyId,expression:"createForm.specifyId"}],attrs:{disabled:e.createForm.setIdLength,placeholder:"示例:home"},model:{value:e.createForm.id,callback:function(t){e.$set(e.createForm,"id",t)},expression:"createForm.id"}})],1),e._v(" "),r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:2===e.role,expression:"role === 2"}],attrs:{label:"指定随机 ID 长度",prop:"id_length"}},[r("el-switch",{on:{change:function(t){return e.setIdLengthChange(t)}},model:{value:e.createForm.setIdLength,callback:function(t){e.$set(e.createForm,"setIdLength",t)},expression:"createForm.setIdLength"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("在允许的范围内指定随机ID的长度,不指定时会使用系统默认设置。")]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})]),e._v(" "),r("el-slider",{directives:[{name:"show",rawName:"v-show",value:e.createForm.setIdLength,expression:"createForm.setIdLength"}],attrs:{"show-input":"",disabled:e.createForm.specifyId,min:e.idConfig.idMinimumLength,max:e.idConfig.idMaximumLength},model:{value:e.createForm.id_length,callback:function(t){e.$set(e.createForm,"id_length",t)},expression:"createForm.id_length"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"目标链接",prop:"url"}},[r("el-input",{attrs:{placeholder:"示例:https://github.com/jwma/jump-jump"},model:{value:e.createForm.url,callback:function(t){e.$set(e.createForm,"url",t)},expression:"createForm.url"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"描述",prop:"description"}},[r("el-input",{attrs:{type:"textarea",placeholder:"示例:某某帖子使用"},model:{value:e.createForm.description,callback:function(t){e.$set(e.createForm,"description",t)},expression:"createForm.description"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"启用?",prop:"is_enable"}},[r("el-switch",{model:{value:e.createForm.is_enable,callback:function(t){e.$set(e.createForm,"is_enable",t)},expression:"createForm.is_enable"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("开启后短链接可以正常被访问,关闭后短链接被访问时会告知用户访问的页面不存在。"),r("br"),e._v(" "),r("strong",[e._v("注意:关闭后不会统计短链接访问的数据。")])]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})])],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.onCreateFormSubmit}},[e._v("添加")]),e._v(" "),r("el-button",{attrs:{size:"mini"},on:{click:e.onCreateFormCancel}},[e._v("取消")])],1)],1)],1)]),e._v(" "),r("el-drawer",{ref:"editFormDrawer",attrs:{visible:e.editFormDrawer,direction:"rtl","before-close":e.handleEditFormDrawerClose},on:{"update:visible":function(t){e.editFormDrawer=t}}},[r("div",{staticStyle:{width:"90%","margin-left":"15px"}},[r("h2",{staticStyle:{"margin-top":"0",color:"#606266"}},[e._v("更新:"+e._s(e.editForm.id))]),e._v(" "),r("el-form",{ref:"editForm",attrs:{model:e.editForm,rules:e.editFormRules}},[r("el-form-item",{attrs:{label:"目标链接",prop:"url"}},[r("el-input",{attrs:{placeholder:"示例:https://github.com/jwma/jump-jump"},model:{value:e.editForm.url,callback:function(t){e.$set(e.editForm,"url",t)},expression:"editForm.url"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"描述",prop:"description"}},[r("el-input",{attrs:{type:"textarea",placeholder:"示例:某某帖子使用"},model:{value:e.editForm.description,callback:function(t){e.$set(e.editForm,"description",t)},expression:"editForm.description"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"启用?",prop:"is_enable"}},[r("el-switch",{model:{value:e.editForm.is_enable,callback:function(t){e.$set(e.editForm,"is_enable",t)},expression:"editForm.is_enable"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("开启后短链接可以正常被访问,关闭后短链接被访问时会告知用户访问的页面不存在。"),r("br"),e._v(" "),r("strong",[e._v("注意:关闭后不会统计短链接访问的数据。")])]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})])],1),e._v(" "),r("el-form-item",{attrs:{label:"创建人"}},[r("span",{staticStyle:{color:"#909399"}},[e._v(e._s(e.editForm.created_by))])]),e._v(" "),r("el-form-item",{attrs:{label:"添加时间"}},[r("span",{staticStyle:{color:"#909399"}},[e._v(e._s(e._f("dateformat")(e.editForm.create_time)))])]),e._v(" "),r("el-form-item",{attrs:{label:"更新时间"}},[r("span",{staticStyle:{color:"#909399"}},[e._v(e._s(e._f("dateformat")(e.editForm.update_time)))])]),e._v(" "),r("el-form-item",[r("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.onEditFormSubmit}},[e._v("更新")]),e._v(" "),r("el-button",{attrs:{size:"mini"},on:{click:e.onEditFormCancel}},[e._v("取消")])],1)],1)],1)]),e._v(" "),r("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:function(t){return e.getList(1)}}},[e._v("刷新")]),e._v(" "),r("el-button",{attrs:{icon:"el-icon-plus",size:"mini",type:"primary"},on:{click:function(t){return e.toCreate()}}},[e._v("添加\n ")]),e._v(" "),r("el-table",{staticStyle:{width:"100%"},attrs:{data:e.list,"max-height":"800",fit:""}},[r("el-table-column",{attrs:{label:"短链接",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-dropdown",{attrs:{size:"small"}},[r("span",{staticClass:"el-dropdown-link",staticStyle:{cursor:"pointer"}},[e._v("\n "+e._s(t.row.id)),r("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),r("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.landingHosts,(function(n){return r("el-dropdown-item",[r("span",{on:{click:function(r){return e.copyShortLink(n+t.row.id,r)}}},[e._v(e._s(n+t.row.id))])])})),1)],1)]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"url",label:"目标链接",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-dropdown",{attrs:{size:"small"}},[r("span",{staticClass:"el-dropdown-link",staticStyle:{cursor:"pointer"}},[r("span",{staticStyle:{width:"200px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap",display:"inline-block"}},[e._v(e._s(t.row.url))])]),e._v(" "),r("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[r("el-dropdown-item",{staticStyle:{"line-height":"18px"}},[r("span",{on:{click:function(r){return e.copyShortLink(t.row.url,r)}}},[e._v(e._s(t.row.url))])])],1)],1)]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"描述",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.description?t.row.description:"-")+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"启用?",width:"70",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("i",{class:{"el-icon-check":e.row.is_enable,"el-icon-close":!e.row.is_enable}})]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"创建人",width:"150",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.created_by)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"添加时间",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("dateformat")(t.row.create_time,"DD/MM/YY"))+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"更新时间",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("dateformat")(t.row.update_time,"DD/MM/YY"))+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{attrs:{size:"mini",circle:"",icon:"el-icon-s-data"},on:{click:function(r){return e.goto({name:"ShortLinkData",params:{id:t.row.id}})}}}),e._v(" "),r("el-button",{attrs:{size:"mini",circle:"",icon:"el-icon-edit-outline"},on:{click:function(r){return e.toEdit(t.row.id)}}}),e._v(" "),r("el-button",{attrs:{type:"danger",size:"mini",icon:"el-icon-delete-solid",circle:""},on:{click:function(r){return e.deleteShortLink(t.row.id)}}})]}}])})],1),e._v(" "),r("div",{staticClass:"paginator-container"},[r("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total,"hide-on-single-page":!0},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleCurrentPageChange}})],1)],1)},o=[],i=r("db72"),a=r("bfad"),c=r("da71"),s=r("61f7"),l=r("2b0e"),u=r("b311"),d=r.n(u);function f(){l["default"].prototype.$message({message:"复制成功",type:"success",duration:1500})}function m(){l["default"].prototype.$message({message:"复制失败",type:"error"})}function h(e,t){var r=new d.a(t.target,{text:function(){return e}});r.on("success",(function(){f(),r.off("error"),r.off("success"),r.destroy()})),r.on("error",(function(){m(),r.off("error"),r.off("success"),r.destroy()})),r.onClick(t)}var p=r("2f62"),v={name:"ShortLinkList",data:function(){var e=function(e,t,r){if(""===t)r(new Error("请输入目标链接"));else{if(!Object(s["b"])(t))return void r(new Error("这不是一个合法的目标链接"));r()}};return{landingHosts:[],list:[],total:0,currentPage:1,pageSize:20,createFormDrawer:!1,idConfig:{idMinimumLength:0,idLength:0,idMaximumLength:0},createForm:{specifyId:!1,setIdLength:!1,id:"",url:"",description:"",is_enable:!1,id_length:0},createFormRules:{url:[{required:!0,validator:e,trigger:"blur"}]},editFormDrawer:!1,editForm:{id:"",url:"",description:"",is_enable:!1,created_by:"",create_time:"",update_time:""},editFormRules:{url:[{validator:e,trigger:"blur"}]}}},created:function(){var e=this;Object(c["a"])().then((function(t){e.landingHosts=t.data.config.landingHosts,e.idConfig=t.data.config.idConfig,e.createForm.id_length=e.idConfig.idLength,e.getList(e.currentPage)}))},computed:Object(i["a"])({},Object(p["b"])(["role"])),methods:{goto:function(e){this.$router.push(e)},copyShortLink:function(e,t){h(e,t)},getList:function(e){var t=this;Object(a["c"])(e,this.pageSize).then((function(r){t.currentPage=e,t.total=r.data.total,t.list=r.data.shortLinks,1!==t.currentPage&&0===t.list.length&&t.total>0&&(t.currentPage=1,t.getList(1))}))},resetCreateForm:function(){this.createForm.specifyId=!1,this.createForm.setIdLength=!1,this.createForm.id="",this.createForm.url="",this.createForm.description="",this.createForm.is_enable=!1},resetEditForm:function(){this.editForm.url="",this.editForm.description="",this.editForm.is_enable=!1,this.editForm.created_by="",this.editForm.create_time="",this.editForm.update_time=""},handlePageSizeChange:function(e){this.pageSize=e,this.currentPage=1,this.getList(1)},handleCurrentPageChange:function(e){this.currentPage=e,this.getList(e)},toCreate:function(){var e=this;Object(c["a"])().then((function(t){e.idConfig=t.data.config.idConfig,e.createForm.id_length=e.idConfig.idLength,e.createFormDrawer=!0}))},handleCreateFormDrawerClose:function(e){this.resetCreateForm(),e()},onCreateFormSubmit:function(){var e=this;this.$refs.createForm.validate((function(t){if(!t)return!1;Object(a["a"])(e.createForm).then((function(t){e.$refs.createFormDrawer.closeDrawer(),e.$notify({title:"添加短链接成功",message:"ID:"+t.data.shortLink.id,type:"success"}),e.getList(e.currentPage)}))}))},onCreateFormCancel:function(){this.resetCreateForm(),this.createFormDrawer=!1},toEdit:function(e){var t=this;Object(a["d"])(e).then((function(e){t.editFormDrawer=!0,t.editForm=e.data.shortLink}))},handleEditFormDrawerClose:function(e){this.resetEditForm(),e()},onEditFormSubmit:function(){var e=this;this.$refs.editForm.validate((function(t){if(!t)return!1;Object(a["g"])(e.editForm.id,e.editForm).then((function(t){e.$refs.editFormDrawer.closeDrawer(),e.$notify({title:"更新成功",message:"ID:"+t.data.shortLink.id,type:"success"}),e.getList(e.currentPage)}))}))},onEditFormCancel:function(){this.resetEditForm(),this.editFormDrawer=!1},deleteShortLink:function(e){var t=this;this.$confirm("此操作会永久删除短链接,是否继续?","删除确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(a["f"])(e).then((function(r){t.$notify({title:"成功删除短链接",message:"ID:".concat(e),type:"success"}),t.getList(t.currentPage)}))}))},specifyIdChange:function(e){e?(this.createForm.setIdLength=!1,this.setIdLengthChange(!1)):this.createForm.id=""},setIdLengthChange:function(e){e?(this.createForm.specifyId=!1,this.specifyIdChange(!1)):this.createForm.id_length=this.idConfig.idLength}}},g=v,b=(r("66cd"),r("2877")),y=Object(b["a"])(g,n,o,!1,null,"03386dae",null);t["default"]=y.exports},a9af:function(e,t,r){},b311:function(e,t,r){ +/*! + * clipboard.js v2.0.6 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */ +(function(t,r){e.exports=r()})(0,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t){function r(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var r=e.hasAttribute("readonly");r||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),r||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var n=window.getSelection(),o=document.createRange();o.selectNodeContents(e),n.removeAllRanges(),n.addRange(o),t=n.toString()}return t}e.exports=r},function(e,t){function r(){}r.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function o(){n.off(e,o),t.apply(r,arguments)}return o._=t,this.on(e,o,r)},emit:function(e){var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,o=r.length;for(n;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=r+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=o()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=o()(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==("undefined"===typeof e?"undefined":i(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}(),l=s,u=r(1),d=r.n(u),f=r(2),m=r.n(f),h="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"===typeof e.action?e.action:this.defaultAction,this.target="function"===typeof e.target?e.target:this.defaultTarget,this.text="function"===typeof e.text?e.text:this.defaultText,this.container="object"===h(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=m()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return _("action",e)}},{key:"defaultTarget",value:function(e){var t=_("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return _("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"===typeof e?[e]:e,r=!!document.queryCommandSupported;return t.forEach((function(e){r=r&&!!document.queryCommandSupported(e)})),r}}]),t}(d.a);function _(e,t){var r="data-clipboard-"+e;if(t.hasAttribute(r))return t.getAttribute(r)}t["default"]=y}])["default"]}))},bfad:function(e,t,r){"use strict";r.d(t,"d",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return a})),r.d(t,"f",(function(){return c})),r.d(t,"g",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"e",(function(){return u}));var n=r("b775");function o(e){return Object(n["a"])({url:"/v1/short-link/".concat(e),method:"get"})}function i(e,t){return Object(n["a"])({url:"/v1/short-link/?page=".concat(e,"&pageSize=").concat(t),method:"get"})}function a(e){return Object(n["a"])({url:"/v1/short-link/",method:"post",data:e})}function c(e){return Object(n["a"])({url:"/v1/short-link/".concat(e),method:"delete"})}function s(e,t){return Object(n["a"])({url:"/v1/short-link/".concat(e),method:"patch",data:t})}function l(e,t){return Object(n["a"])({url:"/v1/short-link/".concat(e,"/latest-request-history?size=").concat(t),method:"get"})}function u(e,t,r){return Object(n["a"])({url:"/v1/short-link/".concat(e,"/data?startDate=").concat(t,"&endDate=").concat(r),method:"get"})}},da71:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return a})),r.d(t,"d",(function(){return c}));var n=r("b775");function o(){return Object(n["a"])({url:"/v1/config",method:"get"})}function i(e){return Object(n["a"])({url:"/v1/config/landing-hosts",method:"patch",data:e})}function a(e){return Object(n["a"])({url:"/v1/config/id-length",method:"patch",data:e})}function c(e){return Object(n["a"])({url:"/v1/config/short-link-404-handling",method:"patch",data:e})}}}]); \ No newline at end of file diff --git a/web/admin/static/js/chunk-545a7d9d.e4d06fea.js b/web/admin/static/js/chunk-545a7d9d.e4d06fea.js deleted file mode 100644 index 316b8b0..0000000 --- a/web/admin/static/js/chunk-545a7d9d.e4d06fea.js +++ /dev/null @@ -1,8 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-545a7d9d"],{4865:function(e,t,r){"use strict";var n=r("68f9"),o=r.n(n);o.a},"68f9":function(e,t,r){},9472:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-main",[r("el-drawer",{ref:"createFormDrawer",attrs:{visible:e.createFormDrawer,direction:"rtl","before-close":e.handleCreateFormDrawerClose},on:{"update:visible":function(t){e.createFormDrawer=t}}},[r("div",{staticStyle:{width:"90%","margin-left":"15px"}},[r("h2",{staticStyle:{"margin-top":"0",color:"#606266"}},[e._v("添加短链接")]),e._v(" "),r("el-form",{ref:"createForm",attrs:{model:e.createForm,rules:e.createFormRules}},[r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:2===e.role,expression:"role === 2"}],attrs:{label:"指定 ID",prop:"id"}},[r("el-switch",{on:{change:function(t){return e.specifyIdChange(t)}},model:{value:e.createForm.specifyId,callback:function(t){e.$set(e.createForm,"specifyId",t)},expression:"createForm.specifyId"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("设置你期望的ID,设置后随机ID将不起作用。")]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})]),e._v(" "),r("el-input",{directives:[{name:"show",rawName:"v-show",value:e.createForm.specifyId,expression:"createForm.specifyId"}],attrs:{disabled:e.createForm.setIdLength,placeholder:"示例:home"},model:{value:e.createForm.id,callback:function(t){e.$set(e.createForm,"id",t)},expression:"createForm.id"}})],1),e._v(" "),r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:2===e.role,expression:"role === 2"}],attrs:{label:"指定随机 ID 长度",prop:"id_length"}},[r("el-switch",{on:{change:function(t){return e.setIdLengthChange(t)}},model:{value:e.createForm.setIdLength,callback:function(t){e.$set(e.createForm,"setIdLength",t)},expression:"createForm.setIdLength"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("在允许的范围内指定随机ID的长度,不指定时会使用系统默认设置。")]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})]),e._v(" "),r("el-slider",{directives:[{name:"show",rawName:"v-show",value:e.createForm.setIdLength,expression:"createForm.setIdLength"}],attrs:{"show-input":"",disabled:e.createForm.specifyId,min:e.idConfig.idMinimumLength,max:e.idConfig.idMaximumLength},model:{value:e.createForm.id_length,callback:function(t){e.$set(e.createForm,"id_length",t)},expression:"createForm.id_length"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"目标链接",prop:"url"}},[r("el-input",{attrs:{placeholder:"示例:https://github.com/jwma/jump-jump"},model:{value:e.createForm.url,callback:function(t){e.$set(e.createForm,"url",t)},expression:"createForm.url"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"描述",prop:"description"}},[r("el-input",{attrs:{type:"textarea",placeholder:"示例:某某帖子使用"},model:{value:e.createForm.description,callback:function(t){e.$set(e.createForm,"description",t)},expression:"createForm.description"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"启用?",prop:"is_enable"}},[r("el-switch",{model:{value:e.createForm.is_enable,callback:function(t){e.$set(e.createForm,"is_enable",t)},expression:"createForm.is_enable"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("开启后短链接可以正常被访问,关闭后短链接被访问时会告知用户访问的页面不存在。"),r("br"),e._v(" "),r("strong",[e._v("注意:关闭后不会统计短链接访问的数据。")])]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})])],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.onCreateFormSubmit}},[e._v("添加")]),e._v(" "),r("el-button",{attrs:{size:"mini"},on:{click:e.onCreateFormCancel}},[e._v("取消")])],1)],1)],1)]),e._v(" "),r("el-drawer",{ref:"editFormDrawer",attrs:{visible:e.editFormDrawer,direction:"rtl","before-close":e.handleEditFormDrawerClose},on:{"update:visible":function(t){e.editFormDrawer=t}}},[r("div",{staticStyle:{width:"90%","margin-left":"15px"}},[r("h2",{staticStyle:{"margin-top":"0",color:"#606266"}},[e._v("更新:"+e._s(e.editForm.id))]),e._v(" "),r("el-form",{ref:"editForm",attrs:{model:e.editForm,rules:e.editFormRules}},[r("el-form-item",{attrs:{label:"目标链接",prop:"url"}},[r("el-input",{attrs:{placeholder:"示例:https://github.com/jwma/jump-jump"},model:{value:e.editForm.url,callback:function(t){e.$set(e.editForm,"url",t)},expression:"editForm.url"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"描述",prop:"description"}},[r("el-input",{attrs:{type:"textarea",placeholder:"示例:某某帖子使用"},model:{value:e.editForm.description,callback:function(t){e.$set(e.editForm,"description",t)},expression:"editForm.description"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"启用?",prop:"is_enable"}},[r("el-switch",{model:{value:e.editForm.is_enable,callback:function(t){e.$set(e.editForm,"is_enable",t)},expression:"editForm.is_enable"}}),e._v(" "),r("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"hover"}},[r("p",[e._v("开启后短链接可以正常被访问,关闭后短链接被访问时会告知用户访问的页面不存在。"),r("br"),e._v(" "),r("strong",[e._v("注意:关闭后不会统计短链接访问的数据。")])]),e._v(" "),r("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})])],1),e._v(" "),r("el-form-item",{attrs:{label:"创建人"}},[r("span",{staticStyle:{color:"#909399"}},[e._v(e._s(e.editForm.created_by))])]),e._v(" "),r("el-form-item",{attrs:{label:"添加时间"}},[r("span",{staticStyle:{color:"#909399"}},[e._v(e._s(e._f("dateformat")(e.editForm.create_time)))])]),e._v(" "),r("el-form-item",{attrs:{label:"更新时间"}},[r("span",{staticStyle:{color:"#909399"}},[e._v(e._s(e._f("dateformat")(e.editForm.update_time)))])]),e._v(" "),r("el-form-item",[r("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.onEditFormSubmit}},[e._v("更新")]),e._v(" "),r("el-button",{attrs:{size:"mini"},on:{click:e.onEditFormCancel}},[e._v("取消")])],1)],1)],1)]),e._v(" "),r("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:function(t){return e.getList(1)}}},[e._v("刷新")]),e._v(" "),r("el-button",{attrs:{icon:"el-icon-plus",size:"mini",type:"primary"},on:{click:function(t){return e.toCreate()}}},[e._v("添加\n ")]),e._v(" "),r("el-table",{staticStyle:{width:"100%"},attrs:{data:e.list,"max-height":"800",fit:""}},[r("el-table-column",{attrs:{label:"短链接",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-dropdown",{attrs:{size:"small"}},[r("span",{staticClass:"el-dropdown-link"},[e._v("\n "+e._s(t.row.id)),r("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),r("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.landingHosts,(function(n){return r("el-dropdown-item",[r("span",{on:{click:function(r){return e.copyShortLink(n+t.row.id,r)}}},[e._v(e._s(n+t.row.id))])])})),1)],1)]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"url",label:"目标链接",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-link",{attrs:{type:"info",href:t.row.url,target:"_blank"}},[e._v(e._s(t.row.url))])]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"描述",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.description?t.row.description:"-")+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"启用?",width:"70",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("i",{class:{"el-icon-check":e.row.is_enable,"el-icon-close":!e.row.is_enable}})]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"创建人",width:"150",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.created_by)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"添加时间",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("dateformat")(t.row.create_time,"DD/MM/YY"))+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"更新时间",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("dateformat")(t.row.update_time,"DD/MM/YY"))+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{attrs:{size:"mini",circle:"",icon:"el-icon-s-data"},on:{click:function(r){return e.goto({name:"ShortLinkLatestRequestHistory",params:{id:t.row.id}})}}}),e._v(" "),r("el-button",{attrs:{size:"mini",circle:"",icon:"el-icon-edit-outline"},on:{click:function(r){return e.toEdit(t.row.id)}}}),e._v(" "),r("el-button",{attrs:{type:"danger",size:"mini",icon:"el-icon-delete-solid",circle:""},on:{click:function(r){return e.deleteShortLink(t.row.id)}}})]}}])})],1),e._v(" "),r("div",{staticClass:"paginator-container"},[r("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total,"hide-on-single-page":!0},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleCurrentPageChange}})],1)],1)},o=[],i=r("db72"),a=r("bfad"),c=r("da71"),s=r("61f7"),l=r("2b0e"),u=r("b311"),d=r.n(u);function f(){l["default"].prototype.$message({message:"复制成功",type:"success",duration:1500})}function m(){l["default"].prototype.$message({message:"复制失败",type:"error"})}function h(e,t){var r=new d.a(t.target,{text:function(){return e}});r.on("success",(function(){f(),r.off("error"),r.off("success"),r.destroy()})),r.on("error",(function(){m(),r.off("error"),r.off("success"),r.destroy()})),r.onClick(t)}var p=r("2f62"),g={name:"ShortLinkList",data:function(){var e=function(e,t,r){if(""===t)r(new Error("请输入目标链接"));else{if(!Object(s["b"])(t))return void r(new Error("这不是一个合法的目标链接"));r()}};return{landingHosts:[],list:[],total:0,currentPage:1,pageSize:20,createFormDrawer:!1,idConfig:{idMinimumLength:0,idLength:0,idMaximumLength:0},createForm:{specifyId:!1,setIdLength:!1,id:"",url:"",description:"",is_enable:!1,id_length:0},createFormRules:{url:[{required:!0,validator:e,trigger:"blur"}]},editFormDrawer:!1,editForm:{id:"",url:"",description:"",is_enable:!1,created_by:"",create_time:"",update_time:""},editFormRules:{url:[{validator:e,trigger:"blur"}]}}},created:function(){var e=this;Object(c["a"])().then((function(t){e.landingHosts=t.data.config.landingHosts,e.idConfig=t.data.config.idConfig,e.createForm.id_length=e.idConfig.idLength,e.getList(e.currentPage)}))},computed:Object(i["a"])({},Object(p["b"])(["role"])),methods:{goto:function(e){this.$router.push(e)},copyShortLink:function(e,t){h(e,t)},getList:function(e){var t=this;Object(a["c"])(e,this.pageSize).then((function(r){t.currentPage=e,t.total=r.data.total,t.list=r.data.shortLinks,1!==t.currentPage&&0===t.list.length&&t.total>0&&(t.currentPage=1,t.getList(1))}))},resetCreateForm:function(){this.createForm.specifyId=!1,this.createForm.setIdLength=!1,this.createForm.id="",this.createForm.url="",this.createForm.description="",this.createForm.is_enable=!1},resetEditForm:function(){this.editForm.url="",this.editForm.description="",this.editForm.is_enable=!1,this.editForm.created_by="",this.editForm.create_time="",this.editForm.update_time=""},handlePageSizeChange:function(e){this.pageSize=e,this.currentPage=1,this.getList(1)},handleCurrentPageChange:function(e){this.currentPage=e,this.getList(e)},toCreate:function(){var e=this;Object(c["a"])().then((function(t){e.idConfig=t.data.config.idConfig,e.createForm.id_length=e.idConfig.idLength,e.createFormDrawer=!0}))},handleCreateFormDrawerClose:function(e){this.resetCreateForm(),e()},onCreateFormSubmit:function(){var e=this;this.$refs.createForm.validate((function(t){if(!t)return!1;Object(a["a"])(e.createForm).then((function(t){e.$refs.createFormDrawer.closeDrawer(),e.$notify({title:"添加短链接成功",message:"ID:"+t.data.shortLink.id,type:"success"}),e.getList(e.currentPage)}))}))},onCreateFormCancel:function(){this.resetCreateForm(),this.createFormDrawer=!1},toEdit:function(e){var t=this;Object(a["d"])(e).then((function(e){t.editFormDrawer=!0,t.editForm=e.data.shortLink}))},handleEditFormDrawerClose:function(e){this.resetEditForm(),e()},onEditFormSubmit:function(){var e=this;this.$refs.editForm.validate((function(t){if(!t)return!1;Object(a["f"])(e.editForm.id,e.editForm).then((function(t){e.$refs.editFormDrawer.closeDrawer(),e.$notify({title:"更新成功",message:"ID:"+t.data.shortLink.id,type:"success"}),e.getList(e.currentPage)}))}))},onEditFormCancel:function(){this.resetEditForm(),this.editFormDrawer=!1},deleteShortLink:function(e){var t=this;this.$confirm("此操作会永久删除短链接,是否继续?","删除确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(a["e"])(e).then((function(r){t.$notify({title:"成功删除短链接",message:"ID:".concat(e),type:"success"}),t.getList(t.currentPage)}))}))},specifyIdChange:function(e){e?(this.createForm.setIdLength=!1,this.setIdLengthChange(!1)):this.createForm.id=""},setIdLengthChange:function(e){e?(this.createForm.specifyId=!1,this.specifyIdChange(!1)):this.createForm.id_length=this.idConfig.idLength}}},v=g,b=(r("4865"),r("2877")),y=Object(b["a"])(v,n,o,!1,null,"65f1ccf6",null);t["default"]=y.exports},b311:function(e,t,r){ -/*! - * clipboard.js v2.0.6 - * https://clipboardjs.com/ - * - * Licensed MIT © Zeno Rocha - */ -(function(t,r){e.exports=r()})(0,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t){function r(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var r=e.hasAttribute("readonly");r||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),r||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var n=window.getSelection(),o=document.createRange();o.selectNodeContents(e),n.removeAllRanges(),n.addRange(o),t=n.toString()}return t}e.exports=r},function(e,t){function r(){}r.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function o(){n.off(e,o),t.apply(r,arguments)}return o._=t,this.on(e,o,r)},emit:function(e){var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,o=r.length;for(n;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=r+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=o()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=o()(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==("undefined"===typeof e?"undefined":i(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}(),l=s,u=r(1),d=r.n(u),f=r(2),m=r.n(f),h="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"===typeof e.action?e.action:this.defaultAction,this.target="function"===typeof e.target?e.target:this.defaultTarget,this.text="function"===typeof e.text?e.text:this.defaultText,this.container="object"===h(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=m()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return _("action",e)}},{key:"defaultTarget",value:function(e){var t=_("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return _("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"===typeof e?[e]:e,r=!!document.queryCommandSupported;return t.forEach((function(e){r=r&&!!document.queryCommandSupported(e)})),r}}]),t}(d.a);function _(e,t){var r="data-clipboard-"+e;if(t.hasAttribute(r))return t.getAttribute(r)}t["default"]=y}])["default"]}))},bfad:function(e,t,r){"use strict";r.d(t,"d",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return a})),r.d(t,"e",(function(){return c})),r.d(t,"f",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r("b775");function o(e){return Object(n["a"])({url:"/v1/short-link/".concat(e),method:"get"})}function i(e,t){return Object(n["a"])({url:"/v1/short-link/?page=".concat(e,"&pageSize=").concat(t),method:"get"})}function a(e){return Object(n["a"])({url:"/v1/short-link/",method:"post",data:e})}function c(e){return Object(n["a"])({url:"/v1/short-link/".concat(e),method:"delete"})}function s(e,t){return Object(n["a"])({url:"/v1/short-link/".concat(e),method:"patch",data:t})}function l(e,t){return Object(n["a"])({url:"/v1/short-link/".concat(e,"/latest-request-history?size=").concat(t),method:"get"})}},da71:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return a})),r.d(t,"d",(function(){return c}));var n=r("b775");function o(){return Object(n["a"])({url:"/v1/config",method:"get"})}function i(e){return Object(n["a"])({url:"/v1/config/landing-hosts",method:"patch",data:e})}function a(e){return Object(n["a"])({url:"/v1/config/id-length",method:"patch",data:e})}function c(e){return Object(n["a"])({url:"/v1/config/short-link-404-handling",method:"patch",data:e})}}}]); \ No newline at end of file