text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-70b6d5cd"],{"2c1a":function(e,t,a){"use strict";a("a56d")},"32d8":function(e,t,a){},"4b3f":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticClass:"content"},[e._m(0),a("div",{staticClass:"login"},[a("a-form",{attrs:{form:e.form},on:{submit:e.onSubmit}},[a("a-form-item",[a("a-input",{attrs:{autocomplete:"autocomplete",name:"username",size:"large",placeholder:"请输入"+e.username_placeholder},model:{value:e.username,callback:function(t){e.username=t},expression:"username"}},[a("a-icon",{attrs:{slot:"prefix",type:"user"},slot:"prefix"})],1)],1),a("a-form-item",[a("a-input",{attrs:{size:"large",name:"password",placeholder:"请输入"+e.password_placeholder,autocomplete:"autocomplete",type:"password"},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}},[a("a-icon",{attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),a("div",[a("a-checkbox",{model:{value:e.isAutoLogin,callback:function(t){e.isAutoLogin=t},expression:"isAutoLogin"}},[e._v("记住密码")]),a("a",{staticStyle:{float:"right"},on:{click:e.clearLoginStorage}},[e._v("清除记录")])],1),a("a-form-item",[a("a-button",{staticClass:"submitbtn",staticStyle:{width:"100%","margin-top":"24px"},attrs:{loading:e.logging,size:"large","html-type":"submit",type:"primary"}},[e._v("登录 ")])],1)],1)],1),a("PageFooter")],1)])},n=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"top"},[a("div",{staticClass:"header"},[a("span",{staticClass:"title"},[e._v("后台管理系统")])]),a("div",{staticClass:"desc"},[e._v("后台管理系统登录")])])}],s=a("1da1"),o=(a("96cf"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"and-admin-footer"},[a("div",{staticClass:"links"},e._l(e.linkList,(function(t,r){return a("a",{key:r,attrs:{target:"_blank",href:t.link?t.link:"javascript: void(0)"}},[t.icon?a("a-icon",{attrs:{type:t.icon}}):e._e(),e._v(" "+e._s(t.name)+" ")],1)})),0),a("div",{staticClass:"copyright"},[e._v(" Copyright "),a("a-icon",{attrs:{type:"copyright"}}),e._v(" "+e._s(e.copyright)+" ")],1)])}),i=[],c={name:"PageFooter",data:function(){return{linkList:[{link:"https://iczer.gitee.io/vue-antd-admin-docs",name:"项目首页"},{link:"https://github.com/iczer/vue-antd-admin",icon:"github"},{link:"https://www.shengxinyustudio.com",name:"作者主页"}],copyright:"Vue Antd Admin 2021"}}},u=c,l=(a("2c1a"),a("2877")),p=Object(l["a"])(u,o,i,!1,null,"71813c36",null),m=p.exports,d=a("89a5"),h={name:"Login",data:function(){return{logging:!1,error:"",form:this.$form.createForm(this),isAutoLogin:!1,actionUrl:"/api/antoa/auth/login",username_placeholder:"请输入用户名",password_placeholder:"请输入密码",username:"",password:""}},components:{PageFooter:m},created:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,e.$api().checkAuthorization()){t.next=3;break}throw"登录失败";case 3:return t.next=5,e.$api("/api/antoa/auth/auth").method("POST").call();case 5:if(a=t.sent,a.status){t.next=8;break}throw"登录失效";case 8:e.goHome(),t.next=13;break;case 11:t.prev=11,t.t0=t["catch"](0);case 13:case"end":return t.stop()}}),t,null,[[0,11]])})))()},mounted:function(){try{var e=localStorage.usernameAndPassword;if(!e)throw"没有发现本地存储的用户名密码";e=JSON.parse(e),this.username=e.username,this.password=e.password}catch(t){}},methods:{onSubmit:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){var r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return e.preventDefault(),a.prev=1,t.form.validateFields((function(e){if(!e)return t.logging=!0,!0})),t.isAutoLogin&&(localStorage.usernameAndPassword=JSON.stringify({username:t.username,password:t.password})),a.next=6,t.$api(t.actionUrl).param({username:t.username,password:t.password}).method("POST").call();case 6:if(r=a.sent,r.status){a.next=9;break}throw r.msg;case 9:t.$api().setLoginToken(r.data),t.logging=!1,t.goHome(),a.next=18;break;case 14:a.prev=14,a.t0=a["catch"](1),t.$message.error(a.t0+""),t.logging=!1;case 18:case"end":return a.stop()}}),a,null,[[1,14]])})))()},onClose:function(){this.error=!1},clearLoginStorage:function(){delete localStorage.usernameAndPassword},goHome:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.$api("/api/antoa/auth/config").method("GET").call();case 3:if(a=t.sent,a.status){t.next=6;break}throw a.msg;case 6:for(r in Object(d["c"])(a.routes),a.routes[0].children)a.routes[0].children[r].meta&&a.routes[0].children[r].meta.is_home&&(localStorage.homeVueApi=a.routes[0].children[r].meta.vue_api);e.$router.push("/home"),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](0),e.$message.error(t.t0+"",5);case 14:case"end":return t.stop()}}),t,null,[[0,11]])})))()}}},g=h,f=(a("6d8d"),Object(l["a"])(g,r,n,!1,null,"7d7349ca",null));t["default"]=f.exports},"6d8d":function(e,t,a){"use strict";a("32d8")},a56d:function(e,t,a){}}]);