diff --git a/admin/config/dev.env.js b/admin/config/dev.env.js index 618c2974835397ac240aea082755b95c5901f2cf..125209471249b95024d62365dad80c955d32f26c 100644 --- a/admin/config/dev.env.js +++ b/admin/config/dev.env.js @@ -5,4 +5,5 @@ const prodEnv = require('./prod.env') module.exports = merge(prodEnv, { NODE_ENV: '"development"', BASE_API: '"http://localhost:8000"', + WEBSOCKET: '"ws://127.0.0.1:5200"', }) diff --git a/admin/config/prod.env.js b/admin/config/prod.env.js index 402631c47958494d083bb4b1d953af948144210e..47001bdbd81bb5ae1c6d9ffb58b5b54d5e84a0ed 100644 --- a/admin/config/prod.env.js +++ b/admin/config/prod.env.js @@ -2,4 +2,5 @@ module.exports = { NODE_ENV: '"production"', BASE_API: '"https://www.guke1.com"', + WEBSOCKET: '"wss://www.guke1.com/ws"', } diff --git a/admin/src/views/api_excel/index.vue b/admin/src/views/api_excel/index.vue index 1ea35bf6a331726f3de721c1fef9eb3724aec9b7..ab5e11bc5da8ed4cd5d30f77cb9884382ab75668 100644 --- a/admin/src/views/api_excel/index.vue +++ b/admin/src/views/api_excel/index.vue @@ -4,6 +4,7 @@ 上传测试 + {{ reload_name }} - + @@ -126,6 +127,7 @@ \ No newline at end of file +Laravel-vue-admin 后台管理系统
\ No newline at end of file diff --git a/laravel/public/static/css/chunk-01a2.65e79044.css b/laravel/public/static/css/chunk-01a2.65e79044.css new file mode 100644 index 0000000000000000000000000000000000000000..fae2d3c72412443d5ff680cc7b495a7f9f92a01e --- /dev/null +++ b/laravel/public/static/css/chunk-01a2.65e79044.css @@ -0,0 +1 @@ +.el-row[data-v-03a7e190]{margin-bottom:20px}.pagination[data-v-03a7e190]{margin:20px auto}.reload[data-v-03a7e190]{margin-right:300px;float:right} \ No newline at end of file diff --git a/laravel/public/static/css/chunk-1553.4abb61ec.css b/laravel/public/static/css/chunk-1553.4abb61ec.css deleted file mode 100644 index af05325749cfdff2c83c60fb411950ba1b608b06..0000000000000000000000000000000000000000 --- a/laravel/public/static/css/chunk-1553.4abb61ec.css +++ /dev/null @@ -1 +0,0 @@ -.el-input[data-v-b740b914]{width:97%;margin-bottom:3%}.input-with-select .el-input-group__prepend[data-v-b740b914]{background-color:#fff} \ No newline at end of file diff --git a/laravel/public/static/css/chunk-62f7.154e764a.css b/laravel/public/static/css/chunk-62f7.154e764a.css new file mode 100644 index 0000000000000000000000000000000000000000..fd54237d592534f0120bec3ef53e720dbf400bac --- /dev/null +++ b/laravel/public/static/css/chunk-62f7.154e764a.css @@ -0,0 +1 @@ +.el-footer[data-v-1a8781ab],.el-header[data-v-1a8781ab]{background-color:#b3c0d1;color:#333;text-align:center;line-height:60px}.el-aside[data-v-1a8781ab]{background-color:#d3dce6;color:#333;text-align:center;line-height:200px}.el-main[data-v-1a8781ab]{background-color:#e9eef3;color:#333;text-align:center;line-height:160px}body>.el-container[data-v-1a8781ab]{margin-bottom:40px}.el-container:nth-child(5) .el-aside[data-v-1a8781ab],.el-container:nth-child(6) .el-aside[data-v-1a8781ab]{line-height:260px}.el-container:nth-child(7) .el-aside[data-v-1a8781ab]{line-height:320px} \ No newline at end of file diff --git a/laravel/public/static/css/chunk-68e9.3747958b.css b/laravel/public/static/css/chunk-68e9.3747958b.css new file mode 100644 index 0000000000000000000000000000000000000000..0bb89693e4e8fcd491e662257e94ea61fdfb9ff9 --- /dev/null +++ b/laravel/public/static/css/chunk-68e9.3747958b.css @@ -0,0 +1 @@ +.el-input[data-v-f8064936]{width:97%;margin-bottom:3%}.input-with-select .el-input-group__prepend[data-v-f8064936]{background-color:#fff} \ No newline at end of file diff --git a/laravel/public/static/css/chunk-6dc4.b2010b43.css b/laravel/public/static/css/chunk-6dc4.b2010b43.css deleted file mode 100644 index 08c76f256330d352c953baaa61747a48a4738ea8..0000000000000000000000000000000000000000 --- a/laravel/public/static/css/chunk-6dc4.b2010b43.css +++ /dev/null @@ -1 +0,0 @@ -.el-footer[data-v-708c40ba],.el-header[data-v-708c40ba]{background-color:#b3c0d1;color:#333;text-align:center;line-height:60px}.el-aside[data-v-708c40ba]{background-color:#d3dce6;color:#333;text-align:center;line-height:200px}.el-main[data-v-708c40ba]{background-color:#e9eef3;color:#333;text-align:center;line-height:160px}body>.el-container[data-v-708c40ba]{margin-bottom:40px}.el-container:nth-child(5) .el-aside[data-v-708c40ba],.el-container:nth-child(6) .el-aside[data-v-708c40ba]{line-height:260px}.el-container:nth-child(7) .el-aside[data-v-708c40ba]{line-height:320px} \ No newline at end of file diff --git a/laravel/public/static/css/chunk-8c07.7ad0908c.css b/laravel/public/static/css/chunk-8c07.7ad0908c.css deleted file mode 100644 index 0f0a47dcb2606e6999aa1ca084f680c16ca0fc05..0000000000000000000000000000000000000000 --- a/laravel/public/static/css/chunk-8c07.7ad0908c.css +++ /dev/null @@ -1 +0,0 @@ -.el-row[data-v-92e9af46]{margin-bottom:20px}.pagination[data-v-92e9af46]{margin:20px auto} \ No newline at end of file diff --git a/laravel/public/static/js/app.f9d9e091.js b/laravel/public/static/js/app.292194fe.js similarity index 99% rename from laravel/public/static/js/app.f9d9e091.js rename to laravel/public/static/js/app.292194fe.js index 72ea47fade6ca870f5da58caae2efb3462b2c324..c0bc0cabd48c75abd2a2d75a27976a28a716d5a2 100644 --- a/laravel/public/static/js/app.f9d9e091.js +++ b/laravel/public/static/js/app.292194fe.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([["app"],{"/OCX":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-ico-table",use:"icon-ico-table-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},"0faV":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-article",use:"icon-article-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},"3PhE":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-nested",use:"icon-nested-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},"6xvN":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},"8fzN":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-tag",use:"icon-tag-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},"96Go":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-ico-aliyun",use:"icon-ico-aliyun-usage",viewBox:"0 0 1844 1024",content:''});o.a.add(s);n.default=s},"9ChT":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-category",use:"icon-category-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},"A0++":function(e,n,t){"use strict";var i=t("xUNX");t.n(i).a},Ahhv:function(e,n,t){},BKkR:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-ico-article",use:"icon-ico-article-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},GPBF:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},Hoqj:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-ico-category",use:"icon-ico-category-usage",viewBox:"0 0 1260 1024",content:''});o.a.add(s);n.default=s},Kj24:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},LyEU:function(e,n,t){"use strict";var i=t("m821");t.n(i).a},MMMJ:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-example",use:"icon-example-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},OXmT:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-permission",use:"icon-permission-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},Q2AE:function(e,n,t){"use strict";var i=t("Kw5r"),a=t("L2JU"),c=t("p46w"),o=t.n(c),s={state:{sidebar:{opened:!+o.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop"},mutations:{TOGGLE_SIDEBAR:function(e){e.sidebar.opened?o.a.set("sidebarStatus",1):o.a.set("sidebarStatus",0),e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1},CLOSE_SIDEBAR:function(e,n){o.a.set("sidebarStatus",1),e.sidebar.opened=!1,e.sidebar.withoutAnimation=n},TOGGLE_DEVICE:function(e,n){e.device=n}},actions:{ToggleSideBar:function(e){(0,e.commit)("TOGGLE_SIDEBAR")},CloseSideBar:function(e,n){(0,e.commit)("CLOSE_SIDEBAR",n.withoutAnimation)},ToggleDevice:function(e,n){(0,e.commit)("TOGGLE_DEVICE",n)}}},l=t("gDS+"),r=t.n(l),d=t("4d7F"),u=t.n(d),h=t("t3Un");var m=t("X4fA"),p={state:{token:Object(m.a)(),name:"",avatar:"",roles:[],addRouters:[]},mutations:{SET_TOKEN:function(e,n){e.token=n},SET_NAME:function(e,n){e.name=n},SET_AVATAR:function(e,n){e.avatar=n},SET_ROLES:function(e,n){e.roles=n},SET_ROUTERS:function(e,n){e.addRouters=n}},actions:{Login:function(e,n){var t=e.commit;return new u.a(function(e,i){(function(e){return h.a.post("/api/user/login",e)})(n).then(function(n){var i=n.data;Object(m.c)(i.access_token),t("SET_TOKEN",i.access_token),e()}).catch(function(e){i(e)})})},GetInfo:function(e){var n=e.commit,t=e.state;return new u.a(function(e,i){(function(e){return Object(h.a)({url:"/api/user/info",method:"get",params:{token:e}})})(t.token).then(function(t){var a=t.data;a.roles&&a.roles.length>0?n("SET_ROLES",a.roles):i("getInfo: roles must be a non-null array !"),n("SET_NAME",a.name),n("SET_AVATAR",a.avatar),e(t)}).catch(function(e){i(e)})})},LogOut:function(e){var n=e.commit,t=e.state;return new u.a(function(e,i){(t.token,Object(h.a)({url:"/api/user/logout",method:"post"})).then(function(){n("SET_TOKEN",""),n("SET_ROLES",[]),Object(m.b)(),sessionStorage.setItem("roles",""),e()}).catch(function(e){i(e)})})},FedLogOut:function(e){var n=e.commit;return new u.a(function(e){n("SET_TOKEN",""),Object(m.b)(),e()})},GenerateRoutes:function(e,n){var t=e.commit;return new u.a(function(e){t("SET_ROUTERS",n.routers),sessionStorage.setItem("roles",r()(n.roles)),e()})}}},v={sidebar:function(e){return e.app.sidebar},device:function(e){return e.app.device},token:function(e){return e.user.token},avatar:function(e){return e.user.avatar},name:function(e){return e.user.name},roles:function(e){return e.user.roles},addRouters:function(e){return e.user.addRouters}};i.default.use(a.a);var f=new a.a.Store({modules:{app:s,user:p},getters:v});n.a=f},"R/Hx":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-table",use:"icon-table-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},TfVu:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});o.a.add(s);n.default=s},TnCw:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-auth",use:"icon-auth-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},"Uf/o":function(e,n,t){var i={"./add.svg":"wqOL","./api.svg":"dHYy","./article.svg":"0faV","./auth.svg":"TnCw","./bus.svg":"jxcm","./category.svg":"9ChT","./example.svg":"MMMJ","./excel.svg":"ZZmv","./eye.svg":"TfVu","./form.svg":"6xvN","./ico-aliyun.svg":"96Go","./ico-article.svg":"BKkR","./ico-category.svg":"Hoqj","./ico-table.svg":"/OCX","./link.svg":"GPBF","./nav.svg":"dbke","./nested.svg":"3PhE","./password.svg":"Kj24","./permission.svg":"OXmT","./role.svg":"Ugzh","./table.svg":"R/Hx","./tag.svg":"8fzN","./task.svg":"dxv6","./tree.svg":"k80C","./user.svg":"s7Vf"};function a(e){var n=c(e);return t(n)}function c(e){var n=i[e];if(!(n+1)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n}a.keys=function(){return Object.keys(i)},a.resolve=c,e.exports=a,a.id="Uf/o"},Ugzh:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-role",use:"icon-role-usage",viewBox:"0 0 1333 1024",content:''});o.a.add(s);n.default=s},Vtdi:function(e,n,t){"use strict";t.r(n);var i=t("Kw5r"),a=(t("9d8Q"),t("XJYT")),c=t.n(a),o=(t("D66Q"),t("cIdk"),t("sg+I"),t("stgD")),s=t.n(o),l=(t("ZOF2"),{name:"App"}),r=(t("A0++"),t("KHd+")),d=Object(r.a)(l,function(){var e=this.$createElement,n=this._self._c||e;return n("div",{attrs:{id:"app"}},[n("router-view")],1)},[],!1,null,null,null);d.options.__file="App.vue";var u=d.exports,h=t("jE9Z");i.default.use(h.a);var m=function(){return t.e("chunk-4c2d").then(t.bind(null,"2c6e"))},p=[].concat([{path:"/",name:"index",component:function(){return t.e("chunk-64b5").then(t.bind(null,"er4n"))},hidden:!0},{path:"/line",name:"line",component:function(){return t.e("chunk-687a").then(t.bind(null,"G5rc"))},hidden:!0},{path:"/home",component:function(){return t.e("chunk-1412").then(t.bind(null,"d7gD"))},hidden:!0},{path:"/md",name:"md",component:function(){return t.e("gW6U").then(t.bind(null,"gW6U"))},hidden:!0},{path:"/out",name:"out",component:function(){return t.e("chunk-132e").then(t.bind(null,"LnUv"))},hidden:!0},{path:"/excel",name:"excel",component:function(){return Promise.all([t.e("chunk-7a80"),t.e("chunk-1553")]).then(t.bind(null,"5EWB"))},hidden:!0},{path:"/upload",name:"upload",component:function(){return t.e("chunk-6dc4").then(t.bind(null,"4p+I"))},hidden:!0},{path:"/websocket",name:"websocket",component:function(){return t.e("chunk-f5ec").then(t.bind(null,"6jsT"))},hidden:!0},{path:"/echarts",name:"echarts",component:function(){return Promise.all([t.e("chunk-7025"),t.e("chunk-6148")]).then(t.bind(null,"HnWs"))},hidden:!0},{path:"/login",component:function(){return t.e("chunk-c8fe").then(t.bind(null,"ntYl"))},hidden:!0},{path:"/404",component:function(){return t.e("chunk-c5f5").then(t.bind(null,"jNvO"))},hidden:!0},{path:"/admin",component:m,redirect:"/admin/dashboard",name:"Dashboard",hidden:!0,children:[{path:"dashboard",component:function(){return Promise.all([t.e("chunk-7025"),t.e("chunk-cfc1")]).then(t.bind(null,"lAbF"))}}]}],[{path:"/form",component:m,children:[{path:"index",name:"Form",component:function(){return t.e("chunk-d818").then(t.bind(null,"Nx2/"))},meta:{title:"Form",icon:"form"}}],hidden:!0},{path:"/nested",component:m,redirect:"/nested/menu1",name:"Nested",meta:{title:"Nested",icon:"nested"},children:[{path:"menu1",component:function(){return t.e("6bwb").then(t.bind(null,"6bwb"))},name:"Menu1",meta:{title:"Menu1"},children:[{path:"menu1-1",component:function(){return t.e("kbPl").then(t.bind(null,"kbPl"))},name:"Menu1-1",meta:{title:"Menu1-1"}},{path:"menu1-2",component:function(){return t.e("Vc2m").then(t.bind(null,"Vc2m"))},name:"Menu1-2",meta:{title:"Menu1-2"},children:[{path:"menu1-2-1",component:function(){return t.e("ZYJW").then(t.bind(null,"ZYJW"))},name:"Menu1-2-1",meta:{title:"Menu1-2-1"}},{path:"menu1-2-2",component:function(){return t.e("tvtM").then(t.bind(null,"tvtM"))},name:"Menu1-2-2",meta:{title:"Menu1-2-2"}}]},{path:"menu1-3",component:function(){return t.e("jYsI").then(t.bind(null,"jYsI"))},name:"Menu1-3",meta:{title:"Menu1-3"}}]},{path:"menu2",component:function(){return t.e("27OO").then(t.bind(null,"27OO"))},meta:{title:"menu2"}}]},{path:"*",redirect:"/404",hidden:!0}]),v=new h.a({scrollBehavior:function(){return{y:0}},routes:p}),f=t("Q2AE"),w={name:"SvgIcon",props:{iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{iconName:function(){return"#icon-"+this.iconClass},svgClass:function(){return this.className?"svg-icon "+this.className:"svg-icon"}}},g=(t("LyEU"),Object(r.a)(w,function(){var e=this.$createElement,n=this._self._c||e;return n("svg",{class:this.svgClass,attrs:{"aria-hidden":"true"}},[n("use",{attrs:{"xlink:href":this.iconName}})])},[],!1,null,"2f0f1ae2",null));g.options.__file="index.vue";var x=g.exports,b={name:"NavBar",data:function(){return{activeIndex:""}}},y=(t("mNmU"),Object(r.a)(b,function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"nav"},[t("el-menu",{staticClass:"el-menu-demo",attrs:{"default-active":e.activeIndex,mode:"horizontal"}},[t("el-row",{attrs:{gutter:1}},[t("el-col",{attrs:{xs:6,sm:6,md:4,lg:4,xl:4}},[t("div",{staticClass:"grid-content"},[t("el-menu-item",{attrs:{index:"1"}},[t("router-link",{attrs:{to:{name:"index"}}},[e._v("公交-首页")])],1)],1)]),e._v(" "),t("el-col",{attrs:{xs:6,sm:6,md:4,lg:4,xl:4}},[t("div",{staticClass:"grid-content"},[t("el-menu-item",{attrs:{index:"3"}},[t("router-link",{staticClass:"login",attrs:{to:{name:"out"}}},[e._v("中文排版")])],1)],1)]),e._v(" "),t("el-col",{attrs:{xs:6,sm:6,md:4,lg:4,xl:4}},[t("div",{staticClass:"grid-content"},[t("el-menu-item",{attrs:{index:"4"}},[t("router-link",{staticClass:"login",attrs:{to:{name:"excel"}}},[e._v("在线表格 Excel")])],1)],1)]),e._v(" "),t("el-col",{attrs:{xs:6,sm:6,md:4,lg:4,xl:4}},[t("div",{staticClass:"grid-content"},[t("el-menu-item",{attrs:{index:"4"}},[t("router-link",{staticClass:"login",attrs:{to:{name:"upload"}}},[e._v("图片转文字")])],1)],1)]),e._v(" "),t("el-col",{attrs:{xs:6,sm:6,md:4,lg:4,xl:4}},[t("div",{staticClass:"grid-content"},[t("el-submenu",{attrs:{index:"2"}},[t("template",{slot:"title"},[e._v("其它工具")]),e._v(" "),t("el-menu-item",{attrs:{index:"2-2"}},[t("router-link",{staticClass:"login",attrs:{to:{name:"md"}}},[e._v("Markdown")])],1),e._v(" "),t("el-menu-item",{attrs:{index:"2-2"}},[t("router-link",{attrs:{to:{name:"echarts"}}},[e._v("图表")])],1)],2)],1)])],1)],1)],1)},[],!1,null,"6308ec4e",null));y.options.__file="navBar.vue";var k=y.exports;i.default.component("svg-icon",x),i.default.component("nav-bar",k);!function(e){e.keys().map(e)}(t("Uf/o"));var M=t("m1cH"),z=t.n(M),B=t("QbLZ"),C=t.n(B),L=function(){return t.e("chunk-4c2d").then(t.bind(null,"2c6e"))},E="Super Administrator",H=[{path:"/api_excel",component:L,redirect:"/api_excel/index",name:"Excel-List",meta:{title:"批量测试管理",icon:"ico-table",roles:[E,"Admin"]},children:[{path:"/api_excel/edit/:id",name:"EditExcel",component:function(){return t.e("chunk-d226").then(t.bind(null,"F/uS"))},hidden:!0},{path:"/api_excel/add",name:"AddExcel",component:function(){return t.e("chunk-2f6b").then(t.bind(null,"wf12"))},meta:{title:"上传测试",icon:"excel",roles:[E,"Admin"]}},{path:"/api_excel/index",name:"Excel",component:function(){return t.e("chunk-8c07").then(t.bind(null,"yWqU"))},meta:{title:"测试管理",icon:"ico-aliyun",roles:[E,"Admin"]}},{path:"/api_param/add",name:"AddApiParam",component:function(){return t.e("chunk-34e9").then(t.bind(null,"eR/3"))},hidden:!0},{path:"/api_param/edit/:id",name:"EditApiParam",component:function(){return t.e("chunk-2227").then(t.bind(null,"/+Eh"))},hidden:!0},{path:"/api_param/index",name:"ApiParam",component:function(){return t.e("chunk-e667").then(t.bind(null,"dH62"))},meta:{title:"接口列表",icon:"api",roles:[E,"Admin"]}}]}],V=[{path:"/category",component:L,redirect:"/category/index",name:"Category-Nav",meta:{title:"栏目菜单",icon:"category",roles:[E]},children:[{path:"/category/add",name:"AddCategory",component:function(){return t.e("chunk-6908").then(t.bind(null,"GMaQ"))},meta:{title:"添加栏目"},hidden:!0},{path:"/category/edit/:id",name:"EditCategory",component:function(){return t.e("chunk-7105").then(t.bind(null,"1ylW"))},hidden:!0},{path:"/category/index",name:"Category",component:function(){return t.e("chunk-4055").then(t.bind(null,"oZKA"))},meta:{title:"栏目管理",icon:"ico-category",roles:[E]}},{path:"/nav/add",name:"AddNav",component:function(){return t.e("chunk-4f15").then(t.bind(null,"JPfX"))},hidden:!0},{path:"/nav/edit/:id",name:"EditNav",component:function(){return t.e("chunk-4332").then(t.bind(null,"LnHU"))},hidden:!0},{path:"/nav",name:"Nav",component:function(){return t.e("chunk-99dd").then(t.bind(null,"mxRw"))},meta:{title:"导航管理",icon:"nav",roles:[E]}},{path:"/tag/add",name:"AddTag",component:function(){return t.e("chunk-82a7").then(t.bind(null,"+1ta"))},meta:{title:"添加标签"},hidden:!0},{path:"/tag/edit/:id",name:"EditTag",component:function(){return t.e("chunk-1dc3").then(t.bind(null,"S2fK"))},hidden:!0},{path:"/tag",name:"Tag",component:function(){return t.e("chunk-ac41").then(t.bind(null,"ZhNY"))},meta:{title:"标签列表",icon:"tag",roles:[E]}}]},{path:"/article",component:L,name:"Article-List",meta:{title:"文章管理",icon:"article",roles:[E]},children:[{path:"/article/edit/:id",name:"EditArticle",component:function(){return t.e("chunk-766b").then(t.bind(null,"++5l"))},hidden:!0},{path:"/article/index",name:"Article",component:function(){return t.e("chunk-9f60").then(t.bind(null,"Iwy+"))},meta:{title:"文章管理",icon:"ico-article",roles:[E]}},{path:"/article/add",name:"AddArticle",component:function(){return t.e("chunk-59d3").then(t.bind(null,"/cac"))},meta:{title:"添加文章",icon:"add",roles:[E]}}]},{path:"/list",component:L,redirect:"/task",name:"公交",meta:{title:"公交管理",icon:"bus",roles:[E]},children:[{path:"/task/search",name:"search",component:function(){return t.e("chunk-ee37").then(t.bind(null,"Keas"))},hidden:!0},{path:"/task/newBus",name:"NewBus",component:function(){return t.e("chunk-3994").then(t.bind(null,"GRON"))},hidden:!0},{path:"/task/edit/:id",name:"taskEdit",component:function(){return t.e("chunk-fc68").then(t.bind(null,"J1Jp"))},hidden:!0},{path:"/task",name:"定时任务",component:function(){return t.e("chunk-775c").then(t.bind(null,"xDC0"))},meta:{title:"定时任务",icon:"task",roles:[E]}},{path:"lines/add",name:"linesAdd",component:function(){return t.e("chunk-00f7").then(t.bind(null,"V9Fe"))},hidden:!0},{path:"lines/edit/:id",name:"linesEdit",component:function(){return t.e("chunk-e830").then(t.bind(null,"bAuQ"))},hidden:!0},{path:"lines",name:"公交列表",component:function(){return t.e("chunk-47b6").then(t.bind(null,"HBaq"))},meta:{title:"公交列表",icon:"table",roles:[E]}},{path:"config",name:"配置管理",component:function(){return t.e("chunk-47b6").then(t.bind(null,"HBaq"))},meta:{title:"配置列表",icon:"table",roles:[E]}},{path:"tree",name:"Tree",component:function(){return t.e("ad09").then(t.bind(null,"ad09"))},meta:{title:"Tree",icon:"tree",roles:[E]},hidden:!0}]},{path:"user",component:L,redirect:"/user",name:"权限",meta:{title:"权限管理",icon:"auth",roles:[E]},children:[{path:"index",name:"userIndex",component:function(){return t.e("chunk-2164").then(t.bind(null,"44Km"))},hidden:!0},{path:"password",name:"userPassword",component:function(){return t.e("chunk-b5cc").then(t.bind(null,"HwY3"))},hidden:!0},{path:"/user/add",name:"AddUser",component:function(){return t.e("chunk-7951").then(t.bind(null,"fqc2"))},hidden:!0},{path:"/user/edit/:id",name:"EditUser",component:function(){return t.e("chunk-f78c").then(t.bind(null,"00Qp"))},hidden:!0},{path:"/user",name:"用户管理",component:function(){return t.e("chunk-2164").then(t.bind(null,"44Km"))},meta:{title:"用户列表",icon:"user",roles:[E]}},{path:"/permission/add",name:"AddPermission",component:function(){return t.e("chunk-0def").then(t.bind(null,"oKS6"))},hidden:!0},{path:"/permission/edit/:id",name:"EditPermission",component:function(){return t.e("chunk-98bc").then(t.bind(null,"t2jL"))},hidden:!0},{path:"/permission",name:"权限列表",component:function(){return t.e("chunk-1496").then(t.bind(null,"wjrd"))},meta:{title:"权限列表",icon:"permission",roles:[E]}},{path:"/role/add",name:"Addroles",component:function(){return t.e("chunk-4707").then(t.bind(null,"rwG5"))},hidden:!0},{path:"/role/edit/:id",name:"Editroles",component:function(){return t.e("chunk-d993").then(t.bind(null,"XqkG"))},hidden:!0},{path:"/role",name:"角色管理",component:function(){return t.e("chunk-5ba7").then(t.bind(null,"bDWH"))},meta:{title:"角色管理",icon:"role",roles:[E]}}]}],A=[],O=t("Mj6V"),_=t.n(O),S=(t("pdi6"),t("X4fA"));if(0===f.a.getters.roles.length&&sessionStorage.getItem("roles")){var I=JSON.parse(sessionStorage.getItem("roles")),T=N(I);f.a.dispatch("GenerateRoutes",{routers:T,roles:I}),v.addRoutes(T)}var F=["/login","/index","/line","/home","/404","/","","/echarts","/md","/out","/excel","/upload"];function Y(e,n){return e.indexOf("Super Administrator")>=0||(!n||e.some(function(e){return n.indexOf(e)>=0}))}function N(e){return e.indexOf("Super Administrator")>=0?[].concat(z()(H),z()(V),z()(A)):e.indexOf("Admin")>=0?H:A}v.beforeEach(function(e,n,t){_.a.start(),Object(S.a)()?"/login"===e.path?(t({path:"/admin"}),_.a.done()):0===f.a.getters.roles.length?f.a.dispatch("GetInfo").then(function(n){var i=N(n.data.roles);sessionStorage.getItem("roles")||v.addRoutes(i),f.a.dispatch("GenerateRoutes",{routers:i,roles:n.data.roles}),!e.meta.role||-1!==F.indexOf(e.path)||Y(n.data.roles,e.meta.roles)?t(C()({},e,{replace:!0})):(t({path:"/404"}),_.a.done())}).catch(function(e){f.a.dispatch("FedLogOut").then(function(){a.Message.error(e||"Verification failed, please login again"),t({path:"/admin"})})}):!e.meta.role||-1!==F.indexOf(e.path)||Y(f.a.getters.roles,e.meta.roles)?t():(t({path:"/404"}),_.a.done()):-1!==F.indexOf(e.path)?t():(t("/login?redirect="+e.path),_.a.done())}),v.afterEach(function(){_.a.done()}),i.default.use(s.a),i.default.use(c.a),i.default.config.productionTip=!1,new i.default({el:"#app",router:v,store:f.a,render:function(e){return e(u)}})},X4fA:function(e,n,t){"use strict";t.d(n,"a",function(){return o}),t.d(n,"c",function(){return s}),t.d(n,"b",function(){return l});var i=t("p46w"),a=t.n(i),c="Admin-Token";function o(){return a.a.get(c)}function s(e){return a.a.set(c,e)}function l(){return a.a.remove(c)}},ZZmv:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-excel",use:"icon-excel-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},dHYy:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-api",use:"icon-api-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},dbke:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-nav",use:"icon-nav-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},dxv6:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-task",use:"icon-task-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},jxcm:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-bus",use:"icon-bus-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},k80C:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-tree",use:"icon-tree-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},m821:function(e,n,t){},mNmU:function(e,n,t){"use strict";var i=t("Ahhv");t.n(i).a},s7Vf:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-user",use:"icon-user-usage",viewBox:"0 0 130 130",content:''});o.a.add(s);n.default=s},"sg+I":function(e,n,t){},t3Un:function(e,n,t){"use strict";var i=t("4d7F"),a=t.n(i),c=t("vDqi"),o=t.n(c),s=t("XJYT"),l=t("Q2AE"),r=t("X4fA"),d=o.a.create({baseURL:"https://www.guke1.com",timeout:5e3});d.interceptors.request.use(function(e){return l.a.getters.token&&(e.headers.Authorization="Bearer "+Object(r.a)()),e},function(e){console.log(e),a.a.reject(e)}),d.interceptors.response.use(function(e){var n=e.data;if(200!==n.code){Object(s.Message)({message:n.reason,type:"error",duration:5e3}),50008!==n.code&&50012!==n.code&&50014!==n.code&&1200!==n.code||s.MessageBox.confirm("你已被登出,可以取消继续留在该页面,或者重新登录","确定登出",{confirmButtonText:"重新登录",cancelButtonText:"取消",type:"warning"}).then(function(){l.a.dispatch("FedLogOut").then(function(){location.reload()})});var t=n.reason?n.reason:"error";return a.a.reject(t)}return e.data},function(e){return console.log("err"+e),Object(s.Message)({message:e.message,type:"error",duration:5e3}),a.a.reject(e)}),n.a=d},wqOL:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-add",use:"icon-add-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},xUNX:function(e,n,t){}},[["Vtdi","runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([["app"],{"/OCX":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-ico-table",use:"icon-ico-table-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},"0faV":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-article",use:"icon-article-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},"3PhE":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-nested",use:"icon-nested-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},"6xvN":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},"8fzN":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-tag",use:"icon-tag-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},"96Go":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-ico-aliyun",use:"icon-ico-aliyun-usage",viewBox:"0 0 1844 1024",content:''});o.a.add(s);n.default=s},"9ChT":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-category",use:"icon-category-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},"A0++":function(e,n,t){"use strict";var i=t("xUNX");t.n(i).a},Ahhv:function(e,n,t){},BKkR:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-ico-article",use:"icon-ico-article-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},GPBF:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},Hoqj:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-ico-category",use:"icon-ico-category-usage",viewBox:"0 0 1260 1024",content:''});o.a.add(s);n.default=s},Kj24:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},LyEU:function(e,n,t){"use strict";var i=t("m821");t.n(i).a},MMMJ:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-example",use:"icon-example-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},OXmT:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-permission",use:"icon-permission-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},Q2AE:function(e,n,t){"use strict";var i=t("Kw5r"),a=t("L2JU"),c=t("p46w"),o=t.n(c),s={state:{sidebar:{opened:!+o.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop"},mutations:{TOGGLE_SIDEBAR:function(e){e.sidebar.opened?o.a.set("sidebarStatus",1):o.a.set("sidebarStatus",0),e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1},CLOSE_SIDEBAR:function(e,n){o.a.set("sidebarStatus",1),e.sidebar.opened=!1,e.sidebar.withoutAnimation=n},TOGGLE_DEVICE:function(e,n){e.device=n}},actions:{ToggleSideBar:function(e){(0,e.commit)("TOGGLE_SIDEBAR")},CloseSideBar:function(e,n){(0,e.commit)("CLOSE_SIDEBAR",n.withoutAnimation)},ToggleDevice:function(e,n){(0,e.commit)("TOGGLE_DEVICE",n)}}},l=t("gDS+"),r=t.n(l),d=t("4d7F"),u=t.n(d),h=t("t3Un");var m=t("X4fA"),p={state:{token:Object(m.a)(),name:"",avatar:"",roles:[],addRouters:[]},mutations:{SET_TOKEN:function(e,n){e.token=n},SET_NAME:function(e,n){e.name=n},SET_AVATAR:function(e,n){e.avatar=n},SET_ROLES:function(e,n){e.roles=n},SET_ROUTERS:function(e,n){e.addRouters=n}},actions:{Login:function(e,n){var t=e.commit;return new u.a(function(e,i){(function(e){return h.a.post("/api/user/login",e)})(n).then(function(n){var i=n.data;Object(m.c)(i.access_token),t("SET_TOKEN",i.access_token),e()}).catch(function(e){i(e)})})},GetInfo:function(e){var n=e.commit,t=e.state;return new u.a(function(e,i){(function(e){return Object(h.a)({url:"/api/user/info",method:"get",params:{token:e}})})(t.token).then(function(t){var a=t.data;a.roles&&a.roles.length>0?n("SET_ROLES",a.roles):i("getInfo: roles must be a non-null array !"),n("SET_NAME",a.name),n("SET_AVATAR",a.avatar),e(t)}).catch(function(e){i(e)})})},LogOut:function(e){var n=e.commit,t=e.state;return new u.a(function(e,i){(t.token,Object(h.a)({url:"/api/user/logout",method:"post"})).then(function(){n("SET_TOKEN",""),n("SET_ROLES",[]),Object(m.b)(),sessionStorage.setItem("roles",""),e()}).catch(function(e){i(e)})})},FedLogOut:function(e){var n=e.commit;return new u.a(function(e){n("SET_TOKEN",""),Object(m.b)(),e()})},GenerateRoutes:function(e,n){var t=e.commit;return new u.a(function(e){t("SET_ROUTERS",n.routers),sessionStorage.setItem("roles",r()(n.roles)),e()})}}},v={sidebar:function(e){return e.app.sidebar},device:function(e){return e.app.device},token:function(e){return e.user.token},avatar:function(e){return e.user.avatar},name:function(e){return e.user.name},roles:function(e){return e.user.roles},addRouters:function(e){return e.user.addRouters}};i.default.use(a.a);var f=new a.a.Store({modules:{app:s,user:p},getters:v});n.a=f},"R/Hx":function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-table",use:"icon-table-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},TfVu:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});o.a.add(s);n.default=s},TnCw:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-auth",use:"icon-auth-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},"Uf/o":function(e,n,t){var i={"./add.svg":"wqOL","./api.svg":"dHYy","./article.svg":"0faV","./auth.svg":"TnCw","./bus.svg":"jxcm","./category.svg":"9ChT","./example.svg":"MMMJ","./excel.svg":"ZZmv","./eye.svg":"TfVu","./form.svg":"6xvN","./ico-aliyun.svg":"96Go","./ico-article.svg":"BKkR","./ico-category.svg":"Hoqj","./ico-table.svg":"/OCX","./link.svg":"GPBF","./nav.svg":"dbke","./nested.svg":"3PhE","./password.svg":"Kj24","./permission.svg":"OXmT","./role.svg":"Ugzh","./table.svg":"R/Hx","./tag.svg":"8fzN","./task.svg":"dxv6","./tree.svg":"k80C","./user.svg":"s7Vf"};function a(e){var n=c(e);return t(n)}function c(e){var n=i[e];if(!(n+1)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n}a.keys=function(){return Object.keys(i)},a.resolve=c,e.exports=a,a.id="Uf/o"},Ugzh:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-role",use:"icon-role-usage",viewBox:"0 0 1333 1024",content:''});o.a.add(s);n.default=s},Vtdi:function(e,n,t){"use strict";t.r(n);var i=t("Kw5r"),a=(t("9d8Q"),t("XJYT")),c=t.n(a),o=(t("D66Q"),t("cIdk"),t("sg+I"),t("stgD")),s=t.n(o),l=(t("ZOF2"),{name:"App"}),r=(t("A0++"),t("KHd+")),d=Object(r.a)(l,function(){var e=this.$createElement,n=this._self._c||e;return n("div",{attrs:{id:"app"}},[n("router-view")],1)},[],!1,null,null,null);d.options.__file="App.vue";var u=d.exports,h=t("jE9Z");i.default.use(h.a);var m=function(){return t.e("chunk-4c2d").then(t.bind(null,"2c6e"))},p=[].concat([{path:"/",name:"index",component:function(){return t.e("chunk-64b5").then(t.bind(null,"er4n"))},hidden:!0},{path:"/line",name:"line",component:function(){return t.e("chunk-687a").then(t.bind(null,"G5rc"))},hidden:!0},{path:"/home",component:function(){return t.e("chunk-1412").then(t.bind(null,"d7gD"))},hidden:!0},{path:"/md",name:"md",component:function(){return t.e("gW6U").then(t.bind(null,"gW6U"))},hidden:!0},{path:"/out",name:"out",component:function(){return t.e("chunk-132e").then(t.bind(null,"LnUv"))},hidden:!0},{path:"/excel",name:"excel",component:function(){return Promise.all([t.e("chunk-7a80"),t.e("chunk-68e9")]).then(t.bind(null,"5EWB"))},hidden:!0},{path:"/upload",name:"upload",component:function(){return t.e("chunk-62f7").then(t.bind(null,"4p+I"))},hidden:!0},{path:"/websocket",name:"websocket",component:function(){return t.e("chunk-f5ec").then(t.bind(null,"6jsT"))},hidden:!0},{path:"/echarts",name:"echarts",component:function(){return Promise.all([t.e("chunk-7025"),t.e("chunk-6148")]).then(t.bind(null,"HnWs"))},hidden:!0},{path:"/login",component:function(){return t.e("chunk-c8fe").then(t.bind(null,"ntYl"))},hidden:!0},{path:"/404",component:function(){return t.e("chunk-c5f5").then(t.bind(null,"jNvO"))},hidden:!0},{path:"/admin",component:m,redirect:"/admin/dashboard",name:"Dashboard",hidden:!0,children:[{path:"dashboard",component:function(){return Promise.all([t.e("chunk-7025"),t.e("chunk-cfc1")]).then(t.bind(null,"lAbF"))}}]}],[{path:"/form",component:m,children:[{path:"index",name:"Form",component:function(){return t.e("chunk-d818").then(t.bind(null,"Nx2/"))},meta:{title:"Form",icon:"form"}}],hidden:!0},{path:"/nested",component:m,redirect:"/nested/menu1",name:"Nested",meta:{title:"Nested",icon:"nested"},children:[{path:"menu1",component:function(){return t.e("6bwb").then(t.bind(null,"6bwb"))},name:"Menu1",meta:{title:"Menu1"},children:[{path:"menu1-1",component:function(){return t.e("kbPl").then(t.bind(null,"kbPl"))},name:"Menu1-1",meta:{title:"Menu1-1"}},{path:"menu1-2",component:function(){return t.e("Vc2m").then(t.bind(null,"Vc2m"))},name:"Menu1-2",meta:{title:"Menu1-2"},children:[{path:"menu1-2-1",component:function(){return t.e("ZYJW").then(t.bind(null,"ZYJW"))},name:"Menu1-2-1",meta:{title:"Menu1-2-1"}},{path:"menu1-2-2",component:function(){return t.e("tvtM").then(t.bind(null,"tvtM"))},name:"Menu1-2-2",meta:{title:"Menu1-2-2"}}]},{path:"menu1-3",component:function(){return t.e("jYsI").then(t.bind(null,"jYsI"))},name:"Menu1-3",meta:{title:"Menu1-3"}}]},{path:"menu2",component:function(){return t.e("27OO").then(t.bind(null,"27OO"))},meta:{title:"menu2"}}]},{path:"*",redirect:"/404",hidden:!0}]),v=new h.a({scrollBehavior:function(){return{y:0}},routes:p}),f=t("Q2AE"),w={name:"SvgIcon",props:{iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{iconName:function(){return"#icon-"+this.iconClass},svgClass:function(){return this.className?"svg-icon "+this.className:"svg-icon"}}},g=(t("LyEU"),Object(r.a)(w,function(){var e=this.$createElement,n=this._self._c||e;return n("svg",{class:this.svgClass,attrs:{"aria-hidden":"true"}},[n("use",{attrs:{"xlink:href":this.iconName}})])},[],!1,null,"2f0f1ae2",null));g.options.__file="index.vue";var x=g.exports,b={name:"NavBar",data:function(){return{activeIndex:""}}},y=(t("mNmU"),Object(r.a)(b,function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"nav"},[t("el-menu",{staticClass:"el-menu-demo",attrs:{"default-active":e.activeIndex,mode:"horizontal"}},[t("el-row",{attrs:{gutter:1}},[t("el-col",{attrs:{xs:6,sm:6,md:4,lg:4,xl:4}},[t("div",{staticClass:"grid-content"},[t("el-menu-item",{attrs:{index:"1"}},[t("router-link",{attrs:{to:{name:"index"}}},[e._v("公交-首页")])],1)],1)]),e._v(" "),t("el-col",{attrs:{xs:6,sm:6,md:4,lg:4,xl:4}},[t("div",{staticClass:"grid-content"},[t("el-menu-item",{attrs:{index:"3"}},[t("router-link",{staticClass:"login",attrs:{to:{name:"out"}}},[e._v("中文排版")])],1)],1)]),e._v(" "),t("el-col",{attrs:{xs:6,sm:6,md:4,lg:4,xl:4}},[t("div",{staticClass:"grid-content"},[t("el-menu-item",{attrs:{index:"4"}},[t("router-link",{staticClass:"login",attrs:{to:{name:"excel"}}},[e._v("在线表格 Excel")])],1)],1)]),e._v(" "),t("el-col",{attrs:{xs:6,sm:6,md:4,lg:4,xl:4}},[t("div",{staticClass:"grid-content"},[t("el-menu-item",{attrs:{index:"4"}},[t("router-link",{staticClass:"login",attrs:{to:{name:"upload"}}},[e._v("图片转文字")])],1)],1)]),e._v(" "),t("el-col",{attrs:{xs:6,sm:6,md:4,lg:4,xl:4}},[t("div",{staticClass:"grid-content"},[t("el-submenu",{attrs:{index:"2"}},[t("template",{slot:"title"},[e._v("其它工具")]),e._v(" "),t("el-menu-item",{attrs:{index:"2-2"}},[t("router-link",{staticClass:"login",attrs:{to:{name:"md"}}},[e._v("Markdown")])],1),e._v(" "),t("el-menu-item",{attrs:{index:"2-2"}},[t("router-link",{attrs:{to:{name:"echarts"}}},[e._v("图表")])],1)],2)],1)])],1)],1)],1)},[],!1,null,"6308ec4e",null));y.options.__file="navBar.vue";var k=y.exports;i.default.component("svg-icon",x),i.default.component("nav-bar",k);!function(e){e.keys().map(e)}(t("Uf/o"));var M=t("m1cH"),z=t.n(M),B=t("QbLZ"),C=t.n(B),L=function(){return t.e("chunk-4c2d").then(t.bind(null,"2c6e"))},E="Super Administrator",H=[{path:"/api_excel",component:L,redirect:"/api_excel/index",name:"Excel-List",meta:{title:"批量测试管理",icon:"ico-table",roles:[E,"Admin"]},children:[{path:"/api_excel/edit/:id",name:"EditExcel",component:function(){return t.e("chunk-d226").then(t.bind(null,"F/uS"))},hidden:!0},{path:"/api_excel/add",name:"AddExcel",component:function(){return t.e("chunk-2f6b").then(t.bind(null,"wf12"))},meta:{title:"上传测试",icon:"excel",roles:[E,"Admin"]}},{path:"/api_excel/index",name:"Excel",component:function(){return t.e("chunk-01a2").then(t.bind(null,"yWqU"))},meta:{title:"测试管理",icon:"ico-aliyun",roles:[E,"Admin"]}},{path:"/api_param/add",name:"AddApiParam",component:function(){return t.e("chunk-34e9").then(t.bind(null,"eR/3"))},hidden:!0},{path:"/api_param/edit/:id",name:"EditApiParam",component:function(){return t.e("chunk-2227").then(t.bind(null,"/+Eh"))},hidden:!0},{path:"/api_param/index",name:"ApiParam",component:function(){return t.e("chunk-e667").then(t.bind(null,"dH62"))},meta:{title:"接口列表",icon:"api",roles:[E,"Admin"]}}]}],V=[{path:"/category",component:L,redirect:"/category/index",name:"Category-Nav",meta:{title:"栏目菜单",icon:"category",roles:[E]},children:[{path:"/category/add",name:"AddCategory",component:function(){return t.e("chunk-6908").then(t.bind(null,"GMaQ"))},meta:{title:"添加栏目"},hidden:!0},{path:"/category/edit/:id",name:"EditCategory",component:function(){return t.e("chunk-7105").then(t.bind(null,"1ylW"))},hidden:!0},{path:"/category/index",name:"Category",component:function(){return t.e("chunk-4055").then(t.bind(null,"oZKA"))},meta:{title:"栏目管理",icon:"ico-category",roles:[E]}},{path:"/nav/add",name:"AddNav",component:function(){return t.e("chunk-4f15").then(t.bind(null,"JPfX"))},hidden:!0},{path:"/nav/edit/:id",name:"EditNav",component:function(){return t.e("chunk-4332").then(t.bind(null,"LnHU"))},hidden:!0},{path:"/nav",name:"Nav",component:function(){return t.e("chunk-99dd").then(t.bind(null,"mxRw"))},meta:{title:"导航管理",icon:"nav",roles:[E]}},{path:"/tag/add",name:"AddTag",component:function(){return t.e("chunk-82a7").then(t.bind(null,"+1ta"))},meta:{title:"添加标签"},hidden:!0},{path:"/tag/edit/:id",name:"EditTag",component:function(){return t.e("chunk-1dc3").then(t.bind(null,"S2fK"))},hidden:!0},{path:"/tag",name:"Tag",component:function(){return t.e("chunk-ac41").then(t.bind(null,"ZhNY"))},meta:{title:"标签列表",icon:"tag",roles:[E]}}]},{path:"/article",component:L,name:"Article-List",meta:{title:"文章管理",icon:"article",roles:[E]},children:[{path:"/article/edit/:id",name:"EditArticle",component:function(){return t.e("chunk-766b").then(t.bind(null,"++5l"))},hidden:!0},{path:"/article/index",name:"Article",component:function(){return t.e("chunk-9f60").then(t.bind(null,"Iwy+"))},meta:{title:"文章管理",icon:"ico-article",roles:[E]}},{path:"/article/add",name:"AddArticle",component:function(){return t.e("chunk-59d3").then(t.bind(null,"/cac"))},meta:{title:"添加文章",icon:"add",roles:[E]}}]},{path:"/list",component:L,redirect:"/task",name:"公交",meta:{title:"公交管理",icon:"bus",roles:[E]},children:[{path:"/task/search",name:"search",component:function(){return t.e("chunk-ee37").then(t.bind(null,"Keas"))},hidden:!0},{path:"/task/newBus",name:"NewBus",component:function(){return t.e("chunk-3994").then(t.bind(null,"GRON"))},hidden:!0},{path:"/task/edit/:id",name:"taskEdit",component:function(){return t.e("chunk-fc68").then(t.bind(null,"J1Jp"))},hidden:!0},{path:"/task",name:"定时任务",component:function(){return t.e("chunk-775c").then(t.bind(null,"xDC0"))},meta:{title:"定时任务",icon:"task",roles:[E]}},{path:"lines/add",name:"linesAdd",component:function(){return t.e("chunk-00f7").then(t.bind(null,"V9Fe"))},hidden:!0},{path:"lines/edit/:id",name:"linesEdit",component:function(){return t.e("chunk-e830").then(t.bind(null,"bAuQ"))},hidden:!0},{path:"lines",name:"公交列表",component:function(){return t.e("chunk-47b6").then(t.bind(null,"HBaq"))},meta:{title:"公交列表",icon:"table",roles:[E]}},{path:"config",name:"配置管理",component:function(){return t.e("chunk-47b6").then(t.bind(null,"HBaq"))},meta:{title:"配置列表",icon:"table",roles:[E]}},{path:"tree",name:"Tree",component:function(){return t.e("ad09").then(t.bind(null,"ad09"))},meta:{title:"Tree",icon:"tree",roles:[E]},hidden:!0}]},{path:"user",component:L,redirect:"/user",name:"权限",meta:{title:"权限管理",icon:"auth",roles:[E]},children:[{path:"index",name:"userIndex",component:function(){return t.e("chunk-2164").then(t.bind(null,"44Km"))},hidden:!0},{path:"password",name:"userPassword",component:function(){return t.e("chunk-b5cc").then(t.bind(null,"HwY3"))},hidden:!0},{path:"/user/add",name:"AddUser",component:function(){return t.e("chunk-7951").then(t.bind(null,"fqc2"))},hidden:!0},{path:"/user/edit/:id",name:"EditUser",component:function(){return t.e("chunk-f78c").then(t.bind(null,"00Qp"))},hidden:!0},{path:"/user",name:"用户管理",component:function(){return t.e("chunk-2164").then(t.bind(null,"44Km"))},meta:{title:"用户列表",icon:"user",roles:[E]}},{path:"/permission/add",name:"AddPermission",component:function(){return t.e("chunk-0def").then(t.bind(null,"oKS6"))},hidden:!0},{path:"/permission/edit/:id",name:"EditPermission",component:function(){return t.e("chunk-98bc").then(t.bind(null,"t2jL"))},hidden:!0},{path:"/permission",name:"权限列表",component:function(){return t.e("chunk-1496").then(t.bind(null,"wjrd"))},meta:{title:"权限列表",icon:"permission",roles:[E]}},{path:"/role/add",name:"Addroles",component:function(){return t.e("chunk-4707").then(t.bind(null,"rwG5"))},hidden:!0},{path:"/role/edit/:id",name:"Editroles",component:function(){return t.e("chunk-d993").then(t.bind(null,"XqkG"))},hidden:!0},{path:"/role",name:"角色管理",component:function(){return t.e("chunk-5ba7").then(t.bind(null,"bDWH"))},meta:{title:"角色管理",icon:"role",roles:[E]}}]}],A=[],O=t("Mj6V"),_=t.n(O),S=(t("pdi6"),t("X4fA"));if(0===f.a.getters.roles.length&&sessionStorage.getItem("roles")){var I=JSON.parse(sessionStorage.getItem("roles")),T=N(I);f.a.dispatch("GenerateRoutes",{routers:T,roles:I}),v.addRoutes(T)}var F=["/login","/index","/line","/home","/404","/","","/echarts","/md","/out","/excel","/upload"];function Y(e,n){return e.indexOf("Super Administrator")>=0||(!n||e.some(function(e){return n.indexOf(e)>=0}))}function N(e){return e.indexOf("Super Administrator")>=0?[].concat(z()(H),z()(V),z()(A)):e.indexOf("Admin")>=0?H:A}v.beforeEach(function(e,n,t){_.a.start(),Object(S.a)()?"/login"===e.path?(t({path:"/admin"}),_.a.done()):0===f.a.getters.roles.length?f.a.dispatch("GetInfo").then(function(n){var i=N(n.data.roles);sessionStorage.getItem("roles")||v.addRoutes(i),f.a.dispatch("GenerateRoutes",{routers:i,roles:n.data.roles}),!e.meta.role||-1!==F.indexOf(e.path)||Y(n.data.roles,e.meta.roles)?t(C()({},e,{replace:!0})):(t({path:"/404"}),_.a.done())}).catch(function(e){f.a.dispatch("FedLogOut").then(function(){a.Message.error(e||"Verification failed, please login again"),t({path:"/admin"})})}):!e.meta.role||-1!==F.indexOf(e.path)||Y(f.a.getters.roles,e.meta.roles)?t():(t({path:"/404"}),_.a.done()):-1!==F.indexOf(e.path)?t():(t("/login?redirect="+e.path),_.a.done())}),v.afterEach(function(){_.a.done()}),i.default.use(s.a),i.default.use(c.a),i.default.config.productionTip=!1,new i.default({el:"#app",router:v,store:f.a,render:function(e){return e(u)}})},X4fA:function(e,n,t){"use strict";t.d(n,"a",function(){return o}),t.d(n,"c",function(){return s}),t.d(n,"b",function(){return l});var i=t("p46w"),a=t.n(i),c="Admin-Token";function o(){return a.a.get(c)}function s(e){return a.a.set(c,e)}function l(){return a.a.remove(c)}},ZZmv:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-excel",use:"icon-excel-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},dHYy:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-api",use:"icon-api-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},dbke:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-nav",use:"icon-nav-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},dxv6:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-task",use:"icon-task-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},jxcm:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-bus",use:"icon-bus-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},k80C:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-tree",use:"icon-tree-usage",viewBox:"0 0 128 128",content:''});o.a.add(s);n.default=s},m821:function(e,n,t){},mNmU:function(e,n,t){"use strict";var i=t("Ahhv");t.n(i).a},s7Vf:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-user",use:"icon-user-usage",viewBox:"0 0 130 130",content:''});o.a.add(s);n.default=s},"sg+I":function(e,n,t){},t3Un:function(e,n,t){"use strict";var i=t("4d7F"),a=t.n(i),c=t("vDqi"),o=t.n(c),s=t("XJYT"),l=t("Q2AE"),r=t("X4fA"),d=o.a.create({baseURL:"https://www.guke1.com",timeout:5e3});d.interceptors.request.use(function(e){return l.a.getters.token&&(e.headers.Authorization="Bearer "+Object(r.a)()),e},function(e){console.log(e),a.a.reject(e)}),d.interceptors.response.use(function(e){var n=e.data;if(200!==n.code){Object(s.Message)({message:n.reason,type:"error",duration:5e3}),50008!==n.code&&50012!==n.code&&50014!==n.code&&1200!==n.code||s.MessageBox.confirm("你已被登出,可以取消继续留在该页面,或者重新登录","确定登出",{confirmButtonText:"重新登录",cancelButtonText:"取消",type:"warning"}).then(function(){l.a.dispatch("FedLogOut").then(function(){location.reload()})});var t=n.reason?n.reason:"error";return a.a.reject(t)}return e.data},function(e){return console.log("err"+e),Object(s.Message)({message:e.message,type:"error",duration:5e3}),a.a.reject(e)}),n.a=d},wqOL:function(e,n,t){"use strict";t.r(n);var i=t("4BeY"),a=t.n(i),c=t("IaFt"),o=t.n(c),s=new a.a({id:"icon-add",use:"icon-add-usage",viewBox:"0 0 1024 1024",content:''});o.a.add(s);n.default=s},xUNX:function(e,n,t){}},[["Vtdi","runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file diff --git a/laravel/public/static/js/chunk-01a2.799243c4.js b/laravel/public/static/js/chunk-01a2.799243c4.js new file mode 100644 index 0000000000000000000000000000000000000000..0d55091808f5afac0b3b9ca98da342a36d3a29d5 --- /dev/null +++ b/laravel/public/static/js/chunk-01a2.799243c4.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-01a2"],{R8mO:function(t,e,n){"use strict";n.d(e,"d",function(){return i}),n.d(e,"e",function(){return r}),n.d(e,"c",function(){return o}),n.d(e,"f",function(){return s}),n.d(e,"a",function(){return c}),n.d(e,"g",function(){return l}),n.d(e,"h",function(){return u}),n.d(e,"b",function(){return d});var a=n("t3Un");function i(t){return Object(a.a)({url:"/api/api_excel",method:"get",params:t})}function r(t){return a.a.post("/api/api_excel",t)}function o(t){return a.a.get("/api/api_excel/"+t)}function s(t,e){return a.a.patch("/api/api_excel/"+t,e)}function c(t){return a.a.delete("/api/api_excel/"+t)}function l(t){return Object(a.a)({url:"/api/api_excel_search",method:"get",params:t})}function u(t){return Object(a.a)({url:"/api/start_task",method:"post",params:t})}function d(t){return Object(a.a)({url:"/api/download_log",method:"post",params:t})}},kXeL:function(t,e,n){"use strict";var a=n("uDov");n.n(a).a},uDov:function(t,e,n){},yWqU:function(t,e,n){"use strict";n.r(e);var a=n("P2sY"),i=n.n(a),r=n("X4fA"),o=n("R8mO"),s={filters:{statusFilter:function(t){return{1:"success",0:"gray","-1":"danger"}[t]}},data:function(){return{reload:!1,reload_name:"点击刷新",list:null,listLoading:!0,perpage:10,total:100,currentpage:1,listQuery:{page:1},url:null,websock:null}},created:function(){this.listQuery=this.$route.query,this.currentpage=parseInt(this.listQuery.page);var t=parseInt(this.$route.query.perPage);this.perpage=isNaN(t)?this.perpage:t,this.initWebSocket()},destroyed:function(){this.websock.close()},methods:{startTask:function(t,e){var n=this;this.$confirm("此操作将开启任务, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(o.h)(e).then(function(t){var a="";200===t.code?(e.state=1,a="success"):a="error",n.$message({type:a,message:t.reason})})}).catch(function(){n.$message({type:"info",message:"已取消操作"})})},openTask:function(t,e){var n=this;this.$alert("此操作将开启任务, 是否继续?","开启任务提醒",{confirmButtonText:"确定",center:!0,type:"warning",callback:function(t){"confirm"===t&&Object(o.h)(e).then(function(t){var a="";200===t.code?(e.state=1,a="success"):a="error",n.$message({type:a,message:t.reason}),n.initWebSocket()})}})},initWebSocket:function(){if("WebSocket"in window){var t="wss://www.guke1.com/ws?action=api_excel&token="+Object(r.a)();this.websock=new WebSocket(t),this.websock.onmessage=this.onmessage,this.websock.onopen=this.onopen,this.websock.onerror=this.onerror,this.websock.onclose=this.close}else this.fetchData(),console.log("Your browser does not support WebSocket!")},onopen:function(){},onerror:function(){this.fetchData()},onmessage:function(t){var e=this,n=JSON.parse(t.data);this.list=n.data.data,this.listLoading=!1,this.total=n.data.total,this.url=n.data.appUrl,setTimeout(function(){e.reload=!1,e.reload_name="刷新"},800)},send:function(t){this.websock.send(t)},close:function(){},download:function(t,e){window.location.href=this.url+e.finish_url},download_log:function(t,e){var n=this;Object(o.b)({id:e.id}).then(function(t){200===t.code&&(window.location.href=n.url+t.data.failed_done_file)})},fetchData:function(){var t=this;this.listLoading=this.reload=!0,this.reload_name="加载中";var e=i()({page:this.listQuery.page},{perPage:this.perpage});Object(o.d)(e).then(function(e){t.list=e.data.data,t.listLoading=!1,t.total=e.data.total,t.url=e.data.appUrl,setTimeout(function(){t.reload=!1,t.reload_name="刷新"},800)})},handleEdit:function(t,e){this.$router.push({path:"/api_excel/edit/"+e.id})},handleDelete:function(t,e){var n=this;this.$confirm("此操作将永久删除该数据, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"error"}).then(function(){Object(o.a)(e.id).then(function(t){n.loading=!1,200===t.code?(n.$message({message:"操作成功",type:"success"}),n.fetchData()):n.$message.error(t.reason)}),n.$message({type:"success",message:"删除成功!"})}).catch(function(){n.$message({type:"info",message:"已取消删除"})})},handleSizeChange:function(t){this.perpage=t,this.$router.push({path:"",query:{page:this.listQuery.page,perPage:t}}),this.fetchData()},handleCurrentChange:function(t){this.listQuery={page:t},this.$router.push({path:"",query:{page:t,perPage:this.perpage}}),this.fetchData({page:t})},goSearch:function(t){var e=this;this.$refs[t].validate(function(t){if(!t)return!1;e.listLoading=!0;var n={wd:e.form.input};Object(o.g)(n).then(function(t){e.listLoading=!1,200===t.code?(e.form.isShow=!0,e.list=t.data.data,e.total=t.data.total):e.$message.error(t.reason)})})}}},c=(n("kXeL"),n("KHd+")),l=Object(c.a)(s,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("el-row",[n("el-button",{attrs:{type:"primary",size:"medium"}},[n("router-link",{attrs:{to:"/api_excel/add"}},[t._v("上传测试")])],1),t._v(" "),n("el-button",{staticClass:"reload",attrs:{loading:t.reload,type:"primary",plain:""},on:{click:t.fetchData}},[t._v(t._s(t.reload_name))])],1),t._v(" "),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.list,"element-loading-text":"Loading",border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{align:"center",label:"ID",width:"70"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.id)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"接口名称",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.api_param.name))])]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"描述内容",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.description))])]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"用户ID",align:"center",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.uid)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"原文件"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.upload_url)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"状态",width:"90",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[0===e.row.state?n("div",[n("el-tag",{attrs:{type:"warning"}},[t._v("未开启")])],1):1===e.row.state?n("div",[n("el-tag",{attrs:{type:"primary"}},[t._v("正在处理")])],1):2===e.row.state?n("div",[n("el-tag",{attrs:{type:"success"}},[t._v("已完成")])],1):n("div",[n("el-tag",{attrs:{type:"info"}},[t._v("失败")])],1)]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"进度条",width:"100",align:"center",display:"none"},scopedSlots:t._u([{key:"default",fn:function(t){return[0===t.row.state?n("div",[n("el-progress",{attrs:{"text-inside":!0,"stroke-width":18,percentage:0}})],1):1===t.row.state?n("div",[n("el-progress",{attrs:{"text-inside":!0,"stroke-width":18,percentage:t.row.rate}})],1):2===t.row.state?n("div",[n("el-progress",{attrs:{"text-inside":!0,"stroke-width":18,percentage:100,status:"success"}})],1):n("div",[n("el-progress",{attrs:{"text-inside":!0,"stroke-width":18,percentage:t.row.rate,status:"exception"}})],1)]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"操作",width:"300",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",[0===e.row.state?n("el-button",{attrs:{size:"mini",type:"warning"},on:{click:function(n){t.openTask(e.$index,e.row)}}},[t._v("点击开启任务")]):1===e.row.state?n("el-button",{attrs:{size:"mini",type:"primary"}},[t._v("...")]):2===e.row.state?n("el-button",{attrs:{size:"mini",type:"success"},on:{click:function(n){t.download(e.$index,e.row)}}},[t._v("点击下载")]):5===e.row.state?n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(n){t.download_log(e.$index,e.row)}}},[t._v("下载已测试数据")]):t._e(),t._v(" "),n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(n){t.handleDelete(e.$index,e.row)}}},[t._v("删除")])],1)]}}])}),t._v(" "),n("el-table-column",{attrs:{align:"center",prop:"created_at",label:"创建时间",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.created_at))])]}}])})],1),t._v(" "),n("div",{staticClass:"pagination"},[n("el-pagination",{attrs:{total:t.total,"current-page":t.currentpage,"page-sizes":[10,20,30,50,100],"page-size":t.perpage,layout:"total, sizes, prev, pager, next, jumper"},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1)},[],!1,null,"03a7e190",null);l.options.__file="index.vue";e.default=l.exports}}]); \ No newline at end of file diff --git a/laravel/public/static/js/chunk-6dc4.46f25fe6.js b/laravel/public/static/js/chunk-62f7.0846ebc0.js similarity index 84% rename from laravel/public/static/js/chunk-6dc4.46f25fe6.js rename to laravel/public/static/js/chunk-62f7.0846ebc0.js index 8cb5bf9fc1c6021e44561fffe0b5dbc886580c9f..23ecf4771cef2740e8022c41300673024755e1d0 100644 --- a/laravel/public/static/js/chunk-6dc4.46f25fe6.js +++ b/laravel/public/static/js/chunk-62f7.0846ebc0.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6dc4"],{"/SEU":function(e,a,t){"use strict";var o=t("nHja");t.n(o).a},"4p+I":function(e,a,t){"use strict";t.r(a);var o=t("t3Un"),n={name:"Upload",data:function(){return{uploadUrl:"https://up.qiniup.com",dialogImageUrl:"",dialogVisible:!1,desc:"",dataObj:{}}},created:function(){var e=this;o.a.get("/api/getToken").then(function(a){e.dataObj={token:a.data.token},console.log(e.dataObj)})},methods:{handleRemove:function(e,a){console.log(e,a)},handlePictureCardPreview:function(e){console.log(e),this.dialogImageUrl=e.url,this.dialogVisible=!0},handleBeforeUpload:function(e){var a=e.name,t=a.substring(a.lastIndexOf("."),a.length).toLowerCase(),o=new Date,n=o.getFullYear()+""+(o.getMonth()+1)+o.getDate()+o.getHours()+o.getMinutes();this.dataObj.key=n+"_"+Math.floor(1e4*Math.random())+t,console.log(this.dataObj)},handleSuccess:function(e,a){console.log(a),console.log(e),this.desc=e.data.words},handleUpload:function(e){console.log(e)}}},l=(t("/SEU"),t("KHd+")),i=Object(l.a)(n,function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",[t("nav-bar"),e._v(" "),t("el-container",[t("el-header",[e._v("图片识别模块")]),e._v(" "),t("el-container",[t("el-aside",{attrs:{width:"500px"}},[t("div",[e._v("点击下面的加号 上传图片")]),e._v(" "),t("el-upload",{attrs:{data:e.dataObj,action:e.uploadUrl,limit:100,"on-preview":e.handlePictureCardPreview,"before-upload":e.handleBeforeUpload,"on-success":e.handleSuccess,"on-remove":e.handleRemove,"list-type":"picture-card"}},[t("i",{staticClass:"el-icon-plus"})]),e._v(" "),t("el-dialog",{attrs:{visible:e.dialogVisible},on:{"update:visible":function(a){e.dialogVisible=a}}},[t("img",{attrs:{src:e.dialogImageUrl,width:"100%",alt:""}})])],1),e._v(" "),t("el-main",[t("el-input",{attrs:{type:"textarea",rows:"50"},model:{value:e.desc,callback:function(a){e.desc=a},expression:"desc"}})],1)],1)],1)],1)},[],!1,null,"708c40ba",null);i.options.__file="upload.vue";a.default=i.exports},nHja:function(e,a,t){}}]); +(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-62f7"],{"+E9z":function(e,a,t){"use strict";var o=t("joBk");t.n(o).a},"4p+I":function(e,a,t){"use strict";t.r(a);var o=t("t3Un"),n={name:"Upload",data:function(){return{uploadUrl:"https://up.qiniup.com",dialogImageUrl:"",dialogVisible:!1,desc:"",dataObj:{}}},created:function(){var e=this;o.a.get("/api/getToken").then(function(a){e.dataObj={token:a.data.token},console.log(e.dataObj)})},methods:{handleRemove:function(e,a){console.log(e,a)},handlePictureCardPreview:function(e){console.log(e),this.dialogImageUrl=e.url,this.dialogVisible=!0},handleBeforeUpload:function(e){var a=e.name,t=a.substring(a.lastIndexOf("."),a.length).toLowerCase(),o=new Date,n=o.getFullYear()+""+(o.getMonth()+1)+o.getDate()+o.getHours()+o.getMinutes();this.dataObj.key=n+"_"+Math.floor(1e4*Math.random())+t,console.log(this.dataObj)},handleSuccess:function(e,a){console.log(a),console.log(e),this.desc=e.data.words},handleUpload:function(e){console.log(e)}}},l=(t("+E9z"),t("KHd+")),i=Object(l.a)(n,function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",[t("nav-bar"),e._v(" "),t("el-container",[t("el-header",[e._v("图片识别模块")]),e._v(" "),t("el-container",[t("el-aside",{attrs:{width:"500px"}},[t("div",[e._v("点击下面的加号 上传图片")]),e._v(" "),t("el-upload",{attrs:{data:e.dataObj,action:e.uploadUrl,limit:100,"on-preview":e.handlePictureCardPreview,"before-upload":e.handleBeforeUpload,"on-success":e.handleSuccess,"on-remove":e.handleRemove,"list-type":"picture-card"}},[t("i",{staticClass:"el-icon-plus"})]),e._v(" "),t("el-dialog",{attrs:{visible:e.dialogVisible},on:{"update:visible":function(a){e.dialogVisible=a}}},[t("img",{attrs:{src:e.dialogImageUrl,width:"100%",alt:""}})])],1),e._v(" "),t("el-main",[t("el-input",{attrs:{type:"textarea",rows:"50"},model:{value:e.desc,callback:function(a){e.desc=a},expression:"desc"}})],1)],1)],1)],1)},[],!1,null,"1a8781ab",null);i.options.__file="upload.vue";a.default=i.exports},joBk:function(e,a,t){}}]); \ No newline at end of file diff --git a/laravel/public/static/js/chunk-1553.fc67014d.js b/laravel/public/static/js/chunk-68e9.ea63a884.js similarity index 85% rename from laravel/public/static/js/chunk-1553.fc67014d.js rename to laravel/public/static/js/chunk-68e9.ea63a884.js index eca322b3d5d86e48d7a343bd1fe407ba8eb97dfb..0dbb9ab5e04de7bec0ac76be009aae3afaa65016 100644 --- a/laravel/public/static/js/chunk-1553.fc67014d.js +++ b/laravel/public/static/js/chunk-68e9.ea63a884.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-1553"],{19:function(e,t){},20:function(e,t){},"5EWB":function(e,t,a){"use strict";a.r(t);var o=a("4d7F"),l=a.n(o),r=a("EUZL"),n=a.n(r),s=a("t3Un"),i={data:function(){return{fileList:[],upLoadNumber:1e5,tableTitle:"",tableData:[],tableHeader:"",uploadUrl:"https://up.qiniup.com",dialogImageUrl:"",dialogVisible:!1,desc:"",dataObj:{}}},created:function(){var e=this;s.a.get("/api/getToken").then(function(t){e.dataObj={token:t.data.token},console.log(e.dataObj)})},methods:{submitUpload:function(){this.$refs.upload.submit()},handleRemove:function(e,t){console.log(e,t)},handlePreview:function(e){console.log(e)},beforeUpload:function(e){var t=this;return new l.a(function(a,o){t.readExcel(e).then(function(e){e&&a(e)})})},readExcel:function(e){console.log(e);var t=this;return new l.a(function(a,o){var l=new FileReader;l.onload=function(e){try{var l=e.target.result,r=n.a.read(l,{type:"binary"}),s=[];for(var i in console.log(r.SheetNames),r.SheetNames){console.log(i);var c=r.SheetNames[i],u=r.Sheets[c];for(var d in u)"!ref"!==d&&s.push(u[d])}var f=n.a.utils.sheet_to_json(r.Sheets[r.SheetNames[0]]);console.log(f);var h=r.SheetNames[0];console.log(h);var p=r.Sheets[r.SheetNames[0]],g=t.get_header_row(p);console.log(g);var v=n.a.utils.sheet_to_json(p);console.log(v),t.generateDate({tableTitle:h,header:g,results:v}),s.length>t.upLoadNumber?(console.log("不能超过"),a(!1)):a(!0)}catch(e){o(e.message)}},l.readAsBinaryString(e)})},generateDate:function(e){var t=e.tableTitle,a=e.header,o=e.results;console.log(t),console.log(a),console.log(o),this.tableTitle=t,this.tableData=o,this.tableHeader=a},handleDrop:function(e){e.stopPropagation(),e.preventDefault();var t=e.dataTransfer.files;if(1===t.length){var a=t[0];this.readerData(a),e.stopPropagation(),e.preventDefault()}else this.$message.error("Only support uploading one file!")},handleDragover:function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy"},readerData:function(e){var t=this;if("xls"!==e.name.split(".")[1]&&"xlsx"!==e.name.split(".")[1])this.$message({message:"上传文件格式错误,请上传xls、xlsx文件!",type:"warning"});else{var a=new FileReader;a.onload=function(e){var a=e.target.result,o=t.fixdata(a),l=n.a.read(btoa(o),{type:"base64"}),r=l.SheetNames[0];console.log(r);var s=l.Sheets[r],i=s["!ref"].split(":")[1];s["!ref"]="A2:"+i;var c=r,u=t.get_header_row(s);console.log(u);var d=n.a.utils.sheet_to_json(s);console.log(d),t.generateDate({tableTitle:c,header:u,results:d})},a.readAsArrayBuffer(e)}},fixdata:function(e){var t="",a=0,o=10240;for(a=0;at.upLoadNumber?(console.log("不能超过"),a(!1)):a(!0)}catch(e){o(e.message)}},l.readAsBinaryString(e)})},generateDate:function(e){var t=e.tableTitle,a=e.header,o=e.results;console.log(t),console.log(a),console.log(o),this.tableTitle=t,this.tableData=o,this.tableHeader=a},handleDrop:function(e){e.stopPropagation(),e.preventDefault();var t=e.dataTransfer.files;if(1===t.length){var a=t[0];this.readerData(a),e.stopPropagation(),e.preventDefault()}else this.$message.error("Only support uploading one file!")},handleDragover:function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy"},readerData:function(e){var t=this;if("xls"!==e.name.split(".")[1]&&"xlsx"!==e.name.split(".")[1])this.$message({message:"上传文件格式错误,请上传xls、xlsx文件!",type:"warning"});else{var a=new FileReader;a.onload=function(e){var a=e.target.result,o=t.fixdata(a),l=n.a.read(btoa(o),{type:"base64"}),r=l.SheetNames[0];console.log(r);var s=l.Sheets[r],i=s["!ref"].split(":")[1];s["!ref"]="A2:"+i;var c=r,u=t.get_header_row(s);console.log(u);var d=n.a.utils.sheet_to_json(s);console.log(d),t.generateDate({tableTitle:c,header:u,results:d})},a.readAsArrayBuffer(e)}},fixdata:function(e){var t="",a=0,o=10240;for(a=0;abelongsToMany(Permission::class); } -//给角色添加权限 +// 给角色添加权限 public function givePermissionTo($permission) { return $this->permissions()->save($permission); @@ -136,7 +136,7 @@ public function assignRole($role) 上面的代码实现了给角色分配权限及给用户分配角色,然后还提供了判断用户是否具有某角色及某权限的方法。 -之后就给使用Laravel提供的Authorization来定义权限控制了,打开 /app/Providers/AuthServiceProvider.php 文件,在 boot() 中添加代码: +之后就给使用 Laravel 提供的 Authorization 来定义权限控制了,打开 /app/Providers/AuthServiceProvider.php 文件,在 boot() 中添加代码: ``` public function boot() diff --git "a/laravel/readme/18. 2019-04-27 \347\256\227\346\263\225.md" "b/laravel/readme/18. 2019-04-27 \347\256\227\346\263\225.md" new file mode 100644 index 0000000000000000000000000000000000000000..065a0527cc95b4421bc62c12860b79e078bc5a36 --- /dev/null +++ "b/laravel/readme/18. 2019-04-27 \347\256\227\346\263\225.md" @@ -0,0 +1,237 @@ +## 算法 + +> 算法(Algorithm)是指解题方案的准确而完整的描述,是一系列解决问题的清晰指令,算法代表着用系统的方法描述解决问题的策略机制。也就是说,能够对一定规范的输入,在有限时间内获得所要求的输出。如果一个算法有缺陷,或不适合于某个问题,执行这个算法将不会解决这个问题。不同的算法可能用不同的时间、空间或效率来完成同样的任务。一个算法的优劣可以用空间复杂度与时间复杂度来衡量。 + +### 算法的特征 + +- 有穷性: 算法的有穷性是指算法必须能在执行有限个步骤之后终止; + +- 确定性: 算法的每一步骤必须有确切的定义; + +- 输入: 一个算法有0个或多个输入 + +- 输出: 一个算法有一个或多个输出,以反映对输入数据加工后的结果 + +- 可行性: 算法中执行的任何计算步骤都是可以被分解为基本的可执行的操作步 + +### 时间复杂度 + +时间复杂度是执行算法所需要的工作量,一般来说,计算机算法是问题规模n 的函数f(n),算法的时间复杂度也因此记做。 + +`T(n)=Ο(f(n))` + +因此,问题的规模n 越大,算法执行的时间的增长率与f(n) 的增长率正相关 + +### 空间复杂度 + +算法的空间复杂度是指算法需要消耗的内存空间。其计算和表示方法与时间 复杂度类似。 + +时间复杂度:平均情况|最好情况|最坏情况 + +排序方式 |平均情况|最坏情况|最好情况 | 空间复杂度 | 稳定性 | 复杂性 +---|---|---|---|---|---|--- +直接插入排序 | O(n^2)|O(n^2)|O(n)|O(1)|稳定|简单 +希尔排序 | O(nlog2n) |O(nlogn2n)| |O(1)|不稳定|较复杂 +冒泡排序 | O(n^2)|O(n^2)|O(n)|O(1)|稳定|简单 +快速排序 | O(nlog2n) |O(n^2)|O(nlog2n)|O(nlog2n) |不稳定|较复杂 +直接选择排序| O(n^2)|O(n^2)|O(n^2)|O(1)|不稳定|简单 +堆排序|O(nlog2n) |O(nlogn2n)| O(nlog2n) |O(1)|不稳定|较复杂 +归并排序|O(nlog2n) |O(nlogn2n)| O(nlog2n) |O(n)|稳定|较复杂 +基数排序|O(d(n+r))|O(d(n+r))|O(d(n+r))|O(n+r)|稳定|较复杂 + + +### 常见算法 + +#### 排序算法 + +- 冒泡排序 + +```php +function BubbleSort(array $container) +{ + $count = count($container); + for ($j = 1; $j < $count; $j++) { + for ($i = 0; $i < $count - $j; $i++) { + if ($container[$i] > $container[$i + 1]) { + $temp = $container[$i]; + $container[$i] = $container[$i + 1]; + $container[$i + 1] = $temp; + } + } + } + return $container; +} +``` +- 插入排序 + +```php +function InsertSort(array $container) +{ + $count = count($container); + for ($i = 1; $i < $count; $i++) { + $temp = $container[$i]; + $j = $i - 1; + // Init + while ($j >= 0 && $container[$j] > $temp) { + $container[$j + 1] = $container[$j]; + $j--; + } + if ($i != $j + 1) + $container[$j + 1] = $temp; + } + return $container; +} + +``` + +- 希尔排序 + +```php +function ShellSort(array $container) +{ + $count = count($container); + for ($increment = intval($count / 2); $increment > 0; $increment = intval($increment / 2)) { + for ($i = $increment; $i < $count; $i++) { + $temp = $container[$i]; + for ($j = $i; $j >= $increment; $j -= $increment) { + if ($temp < $container[$j - $increment]) { + $container[$j] = $container[$j - $increment]; + } else { + break; + } + } + $container[$j] = $temp; + } + } + return $container; +} +``` + + + +- 选择排序 + +```php +function SelectSort(array $container) +{ + $count = count($container); + for ($i = 0; $i < $count; $i++) { + $k = $i; + for ($j = $i + 1; $j < $count; $j++) { + if ($container[$j] < $container[$k]) { + $k = $j; + } + } + if ($k != $i) { + $temp = $container[$i]; + $container[$i] = $container[$k]; + $container[$k] = $temp; + } + } + return $container; +} +``` + +- 快速排序 + +```php +function QuickSort(array $container) +{ + $count = count($container); + if ($count <= 1) { // 基线条件为空或者只包含一个元素,只需要原样返回数组 + return $container; + } + $pivot = $container[0]; // 基准值 pivot + $left = $right = []; + for ($i = 1; $i < $count; $i++) { + if ($container[$i] < $pivot) { + $left[] = $container[$i]; + } else { + $right[] = $container[$i]; + } + } + $left = QuickSort($left); + $right = QuickSort($right); + return array_merge($left, [$container[0]], $right); +} +``` + +- 归并排序 + +- 堆排序 + +#### 查找算法 + +- 顺序查找 + +```php +function find($array, $target) +{ + foreach ($array as $key => $value) { + if ($value === $target) { + return $key; + } + } + return false; +} +``` + +- 有序查找(二分查找) + +```php +function BinaryQueryRecursive(array $container, $search, $low = 0, $top = 'default') +{ + $top == 'default' && $top = count($container); + if ($low <= $top) { + $mid = intval(floor($low + $top) / 2); + if (!isset($container[$mid])) { + return false; + } + if ($container[$mid] == $search) { + return $mid; + } + if ($container[$mid] < $search) { + return BinaryQueryRecursive($container, $search, $mid + 1, $top); + } else { + return BinaryQueryRecursive($container, $search, $low, $mid - 1); + } + } +} +``` + + +- 动态查找(BST) +- 哈希表 O(1) + +### 算法的思想 + +- 迭代 +- 递归 +- 动态规划 +- 回溯 +- 分治 +- 贪心 + +### 算法相关的面试题 + +- 字符串 + + - 查找字符串中的字符 + - 翻转字符串 + +- 排序 + + - 冒泡排序 + - 快速排序 + - 归并排序 + +- 链表 + + - 翻转链表 + - 链表有没有环 + +- 二叉搜索树 + + - 二叉树的深度 + - 二叉树的遍历 + - 重建二叉树 diff --git "a/laravel/readme/19. 2019-05-01-\346\236\266\346\236\204\345\222\214\350\256\276\350\256\24101.md" "b/laravel/readme/19. 2019-05-01-\346\236\266\346\236\204\345\222\214\350\256\276\350\256\24101.md" new file mode 100644 index 0000000000000000000000000000000000000000..89f9ffcdafdd5a60599fe5307d53f60f3312e831 --- /dev/null +++ "b/laravel/readme/19. 2019-05-01-\346\236\266\346\236\204\345\222\214\350\256\276\350\256\24101.md" @@ -0,0 +1,122 @@ +## 架构和设计 + +架构和设计是面试中经常用到的,一是考察你的知识面,而是考察你接触的系统的复杂程序。本文可能介绍一些相关的问题。 + +### 1. 数据库结构设计 + +- 主从复制 +- 分库分表 +- 双主互备 +- 数据库中间件 + + + +为了解决单表数据过多,一般会采取分片【分库分表】水平切分,分片会产生路由,上层应用要知道数据在哪一个库中。 + +路由规则常用的有三种方法 + +- range 范围 + +- 哈希 +- 路由服务 + +#### 可用性 + +为了解决单点的故障,一般引入**主从复制**,也就是垂直分割。 + +采取**双主互备**【keplived】,冗余写库,双主当主从用 + +解决同步冲突,有两种常见解决方案 + +- 两个写库设置不同的初始化,相同步长增加id +- 业务层自己生成唯一的id,保证数据不冲突 + +#### 一致性 + +主从数据库的一致性,通常有两种解决方案: + +- 中间件 + +中间件屏蔽了集群了,对外伪装成一个server。 + +- 强制读主 + +### SESSION架构设计 + +服务器为每个用户创建一个会话,存储用户的相关信息,以便多次请求能够定位到同一个上下文。 只要用户不重启浏览器,会话就一直存在。 + +- session 同步法:多台 web-server 相互同步数据 +- 客户端存储法:一个用户只存储自己的数据 +- 反向代理hash一致性:四层hash和七层hash都可以做,保证一个用户的请求落在一台web-server上 +- 后端统一存储:web-server重启和扩容,session也不会丢失 + +## 缓存架构设计 + +淘汰缓存机制 + +(1)淘汰缓存是一种通用的缓存处理方式 + +(2)先**淘汰缓存,再写数据库**的时序是毋庸置疑的 + +(3)服务化是向业务方屏蔽底层数据库与缓存复杂性的一种通用方式 + + + +设计一个缓存系统,不得不要考虑的问题就是:缓存穿透、缓存击穿与失效时的雪崩效应 + +### 缓存穿透 + +缓存穿透是指查询一个一定不存在的数据,由于缓存是不命中时被动写的,并且出于容错考虑,如果从存储层查不到数据则不写入缓存,这将导致这个不存在的数据每次请求都要到存储层去查询,失去了缓存的意义。在流量大时,可能DB就挂掉了,要是有人利用不存在的key频繁攻击我们的应用,这就是漏洞。 + +### 缓存穿透解决方案 + +有很多种方法可以有效地解决缓存穿透问题,最常见的则是采用布隆过滤器,将所有可能存在的数据哈希到一个足够大的bitmap中,一个一定不存在的数据会被 这个bitmap拦截掉,从而避免了对底层存储系统的查询压力。另外也有一个更为简单粗暴的方法(我们采用的就是这种),如果一个查询返回的数据为空(不管是数 据不存在,还是系统故障),我们仍然把这个空结果进行缓存,但它的过期时间会很短,最长不超过五分钟。 + +### 缓存雪崩 + +缓存雪崩是指在我们设置缓存时采用了相同的过期时间,导致缓存在某一时刻同时失效,请求全部转发到DB,DB瞬时压力过重雪崩。 + +### 缓存雪崩解决方案 + +缓存失效时的雪崩效应对底层系统的冲击非常可怕。大多数系统设计者考虑用加锁或者队列的方式保证缓存的单线 程(进程)写,从而避免失效时大量的并发请求落到底层存储系统上。这里分享一个简单方案就时讲缓存失效时间分散开,比如我们可以在原有的失效时间基础上增加一个随机值,比如1-5分钟随机,这样每一个缓存的过期时间的重复率就会降低,就很难引发集体失效的事件。 + +### 缓存击穿 + +对于一些设置了过期时间的key,如果这些key可能会在某些时间点被超高并发地访问,是一种非常“热点”的数据。这个时候,需要考虑一个问题:缓存被“击穿”的问题,这个和缓存雪崩的区别在于这里针对某一key缓存,前者则是很多key。 + +缓存在某个时间点过期的时候,恰好在这个时间点对这个Key有大量的并发请求过来,这些请求发现缓存过期一般都会从后端DB加载数据并回设到缓存,这个时候大并发的请求可能会瞬间把后端DB压垮。 + +### 缓存击穿 解决方案 + +#### 1.使用互斥锁(mutex key) + +业界比较常用的做法,是使用mutex。简单地来说,就是在缓存失效的时候(判断拿出来的值为空),不是立即去load db,而是先使用缓存工具的某些带成功操作返回值的操作(比如Redis的SETNX或者Memcache的ADD)去set一个mutex key,当操作返回成功时,再进行load db的操作并回设缓存;否则,就重试整个get缓存的方法。 + +SETNX,是「SET if Not eXists」的缩写,也就是只有不存在的时候才设置,可以利用它来实现锁的效果。在redis2.6.1之前版本未实现setnx的过期时间 + +#### 2. "提前"使用互斥锁(mutex key): + +在value内部设置1个超时值(timeout1), timeout1比实际的memcache timeout(timeout2)小。当从cache读取到timeout1发现它已经过期时候,马上延长timeout1并重新设置到cache。然后再从数据库加载数据并设置到cache中 + +#### 3. "永远不过期": + +这里的“永远不过期”包含两层意思: + +> (1) 从redis上看,确实没有设置过期时间,这就保证了,不会出现热点key过期问题,也就是“物理”不过期。 +> +> (2) 从功能上看,如果不过期,那不就成静态的了吗?所以我们把过期时间存在key对应的value里,如果发现要过期了,通过一个后台的异步线程进行缓存的构建,也就是“逻辑”过期 + +​ 从实战看,这种方法对于性能非常友好,唯一不足的就是构建缓存时候,其余线程(非构建缓存的线程)可能访问的是老数据,但是对于一般的互联网功能来说这个还是可以忍受。 + +#### 4. 资源保护: + +采用netflix的hystrix,可以做资源的隔离保护主线程池,如果把这个应用到缓存的构建也未尝不可。 + +四种解决方案:没有最佳只有最合适 + +| 解决方案 | 优点 | 缺点 | +| ----------------------------- | -------------------------------------------------------- | ------------------------------------------------------------ | +| 简单分布式互斥锁(mutex key) | 1. 思路简单 2. 保证一致性 | 1. 代码复杂度增大 2. 存在死锁的风险 3. 存在线程池阻塞的风险 | +| “提前”使用互斥锁 | 1. 保证一致性 | 同上 | +| 不过期(本文) | 1. 异步构建缓存,不会阻塞线程池 | 1. 不保证一致性。 2. 代码复杂度增大(每个value都要维护一个timekey)。 3. 占用一定的内存空间(每个value都要维护一个timekey)。 | +| 资源隔离组件hystrix(本文) | 1. hystrix技术成熟,有效保证后端。 2. hystrix监控强大。 | 1. 部分访问存在降级策略。 | diff --git "a/laravel/readme/19. 2019-05-01-\346\236\266\346\236\204\345\222\214\350\256\276\350\256\24102-API\350\256\276\350\256\241.md" "b/laravel/readme/19. 2019-05-01-\346\236\266\346\236\204\345\222\214\350\256\276\350\256\24102-API\350\256\276\350\256\241.md" new file mode 100644 index 0000000000000000000000000000000000000000..79a6337769625cc4e34fad1fa08edb8d8b886521 --- /dev/null +++ "b/laravel/readme/19. 2019-05-01-\346\236\266\346\236\204\345\222\214\350\256\276\350\256\24102-API\350\256\276\350\256\241.md" @@ -0,0 +1,87 @@ +## REST API + +REST(Representational State Transfer)表述性状态转换,**REST指的是一组架构约束条件和原则** 。 + +使用URL定位资源,用HTTP动词(GET,POST,PUT,DELETE)描述操作。 + +### 基本概念 + +- 资源 + + > 资源就是网络上的一个实体,一段文本,一张图片或者一首歌曲。资源总是要通过一种载体来反应它的内容。文本可以用TXT,也可以用HTML或者XML、图片可以用JPG格式或者PNG格式,JSON是现在最常用的资源表现形式。 + +- 统一资源接口 + + > 统一接口。RESTful风格的数据元操CRUD(create,read,update,delete)分别对应HTTP方法:GET用来获取资源,POST用来新建资源(也可以用于更新资源),PUT用来更新资源,DELETE用来删除资源,这样就统一了数据操作的接口。 + + - GET 获取资源 + - PUT更新资源 + - POST 新增资源 + - DELETE 删除 + +- URI + + > URI。可以用一个URI(统一资源定位符)指向资源,即每个URI都对应一个特定的资源。要获取这个资源访问它的URI就可以,因此URI就成了每一个资源的地址或识别符。一般的,每个资源至少有一个URI与之对应,最典型的URI就是URL。 + +- 无状态 + + > 所谓无状态即所有的资源都可以URI定位,而且这个定位与其他资源无关,也不会因为其他资源的变化而变化。有状态和无状态的区别,举个例子说明一下,例如要查询员工工资的步骤为第一步:登录系统。第二步:进入查询工资的页面。第三步:搜索该员工。第四步:点击姓名查看工资。这样的操作流程就是有状态的,查询工资的每一个步骤都依赖于前一个步骤,只要前置操作不成功,后续操作就无法执行。如果输入一个URL就可以得到指定员工的工资,则这种情况就是无状态的,因为获取工资不依赖于其他资源或状态,且这种情况下,员工工资是一个资源,由一个URL与之对应可以通过HTTP中的GET方法得到资源,这就是典型的RESTful风格。 + + + +### 设计风格 + +- 协议 + + API接口通讯,一般是通过HTTP[s]协议。 + +- 域名 + + 域名应单独部署到对应的域名。 + + ```php + api.github.com + ``` + +- 版本控制 + + ``` + api.github.com/v1/ + ``` + +- 路径规则 + + 路径中,不要出现动词。比如getUsers。复数表示获取集合数组 + + ``` + /v1/user/10 获取id为10的用户 + /v1/users 获取所有用户 + ``` + +- HTTP请求方式表示动作 + + - GET 表示获取资源 + - PUT 更新资源 + - POST新增资源 + - DELETE 删除资源 + + ``` + GET /users + PUT /user/10 + POST /user/10 + DELETE /user/10 + ``` + +- 过滤信息 + + 如果记录过多,可以使用分页过滤信息 + + - ?limit=10 指定返回记录的数量 + - ?offset=10:指定返回记录的开始位置。 + - ?page=2&per_page=100:指定第几页,以及每页的记录数。 + - ?sortby=name&order=asc:指定返回结果按照哪个属性排序,以及排序顺序 + - ?producy_type=1:指定筛选条件 + +- 异常响应 + + 当 RESTful API 接口出现非 2xx 的 HTTP 错误码响应时,采用全局的异常结构响应信息。 diff --git "a/laravel/readme/9. 2019-01-05-Vue \344\270\255\345\274\225\347\224\250 Iconfont \351\230\277\351\207\214\345\267\264\345\267\264\347\237\242\351\207\217\345\233\276.md" "b/laravel/readme/9. 2019-01-05-Vue \344\270\255\345\274\225\347\224\250 Iconfont \351\230\277\351\207\214\345\267\264\345\267\264\347\237\242\351\207\217\345\233\276.md" index bb2432d86caff129d814e031ce768909d724555d..32772d735843d893a3d4d65573dba31c7e052348 100644 --- "a/laravel/readme/9. 2019-01-05-Vue \344\270\255\345\274\225\347\224\250 Iconfont \351\230\277\351\207\214\345\267\264\345\267\264\347\237\242\351\207\217\345\233\276.md" +++ "b/laravel/readme/9. 2019-01-05-Vue \344\270\255\345\274\225\347\224\250 Iconfont \351\230\277\351\207\214\345\267\264\345\267\264\347\237\242\351\207\217\345\233\276.md" @@ -56,5 +56,4 @@ Vue 中在 `src/App.vue` 中添加: 参考地址: 1. [Vue Element使用icon图标(第三方)](https://www.jianshu.com/p/59dd28f0b9c9) 2. [Vue Element-UI使用icon图标(第三方)--在线版](https://www.jianshu.com/p/8379597e3f97) -3. -点击直达 [阿里巴巴矢量图 iconfont.cn](http://www.iconfont.cn/) +3. 点击直达 [阿里巴巴矢量图 iconfont.cn](http://www.iconfont.cn/) diff --git a/laravel/routes/web.php b/laravel/routes/web.php index 33102f597f6eb9a1bd0aa2ebf6bc1a64f73ed2b9..f8b80ffd05c6b97e29cf1b1b0732acb2fe097f2b 100644 --- a/laravel/routes/web.php +++ b/laravel/routes/web.php @@ -45,7 +45,7 @@ Route::group(['namespace' => 'Bus', 'prefix' => 'api'], function () { Route::any('line', 'NewApiController@getList'); Route::any('new_line', 'NewApiController@newBusLine'); Route::any('output', 'NewApiController@output'); - Route::any('test', 'NewApiController@Task'); + Route::any('test', 'NewApiController@jwt'); // 1. 获取七牛上传操作的 token Route::get('getToken', 'AutoController@getToken');