(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5945e82b"],{"28e5":function(e,r,n){"use strict";n("dc26")},dc26:function(e,r,n){},dd7b:function(e,r,n){"use strict";n.r(r);var i=function(){var e=this,r=e.$createElement,n=e._self._c||r;return n("div")},t=[],o=(n("14d9"),n("7ded")),a=n("852e"),s=n.n(a),c=n("24e5"),d=n.n(c),u="MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\nnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==",g="MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\nPuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\nkM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\ncSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\nDQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\nYhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\nUP8iWi1Qw0Y=";function h(e){var r=new d.a;return r.setPublicKey(u),r.encrypt(e)}function l(e){var r=new d.a;return r.setPrivateKey(g),r.decrypt(e)}var m={name:"Login",data:function(){return{codeUrl:"",loginForm:{username:"gongsi",password:"123456",rememberMe:!1,code:"",uuid:""},loginRules:{username:[{required:!0,trigger:"blur",message:"请输入您的账号"}],password:[{required:!0,trigger:"blur",message:"请输入您的密码"}],code:[{required:!0,trigger:"change",message:"请输入验证码"}]},loading:!1,captchaEnabled:!1,register:!1,redirect:void 0}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},created:function(){this.getCode(),this.getCookie(),this.handleLogin()},methods:{getCode:function(){var e=this;Object(o["a"])().then((function(r){e.captchaEnabled=void 0===r.captchaEnabled||r.captchaEnabled,e.captchaEnabled&&(e.codeUrl="data:image/gif;base64,"+r.img,e.loginForm.uuid=r.uuid)}))},getCookie:function(){var e=s.a.get("username"),r=s.a.get("password"),n=s.a.get("rememberMe");this.loginForm={username:void 0===e?this.loginForm.username:e,password:void 0===r?this.loginForm.password:l(r),rememberMe:void 0!==n&&Boolean(n)}},handleLogin:function(){var e=this;this.loading=!0,this.loginForm.rememberMe?(s.a.set("username",this.loginForm.username,{expires:30}),s.a.set("password",h(this.loginForm.password),{expires:30}),s.a.set("rememberMe",this.loginForm.rememberMe,{expires:30})):(s.a.remove("username"),s.a.remove("password"),s.a.remove("rememberMe")),this.$store.dispatch("Login",this.loginForm).then((function(){e.$router.push({path:e.redirect||"/"}).catch((function(){}))})).catch((function(){e.loading=!1,e.captchaEnabled&&e.getCode()}))}}},A=m,f=(n("28e5"),n("2877")),p=Object(f["a"])(A,i,t,!1,null,null,null);r["default"]=p.exports}}]);