(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-36f6c62a"],{"0941":function(t,e,o){"use strict";o("662f")},2017:function(t,e,o){"use strict";o("cafe")},"662f":function(t,e,o){},"9ed6":function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"login-container"},[o("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:t.loginForm,"auto-complete":"on","label-position":"left"}},[o("div",{staticClass:"title-container"},[o("h3",{staticClass:"title"},[t._v("湖南智企云数据中心开放平台")])]),o("el-form-item",{attrs:{prop:"username"}},[o("span",{staticClass:"svg-container el-icon-user-solid"}),o("el-input",{ref:"username",attrs:{placeholder:"请输入手机号/邮箱",name:"username",type:"text","auto-complete":"on"},model:{value:t.loginForm.username,callback:function(e){t.$set(t.loginForm,"username",e)},expression:"loginForm.username"}})],1),o("el-form-item",{attrs:{prop:"password"}},[o("span",{staticClass:"svg-container el-icon-lock"}),o("el-input",{key:t.passwordType,ref:"password",attrs:{type:t.passwordType,placeholder:"请输入登录密码",name:"password","auto-complete":"on"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleLogin(e)}},model:{value:t.loginForm.password,callback:function(e){t.$set(t.loginForm,"password",e)},expression:"loginForm.password"}}),o("span",{staticClass:"show-pwd",on:{click:t.showPwd}},[o("svg-icon",{attrs:{"icon-class":"password"===t.passwordType?"eye":"eye-open"}})],1)],1),o("el-form-item",{attrs:{prop:"password"}},[o("span",{staticClass:"svg-container el-icon-warning"}),o("el-input",{ref:"captcha",attrs:{placeholder:"请输入验证码",name:"captcha",type:"text"},model:{value:t.loginForm.captcha,callback:function(e){t.$set(t.loginForm,"captcha",e)},expression:"loginForm.captcha"}}),o("img",{staticClass:"show-pwd",staticStyle:{height:"38px"},attrs:{src:t.captcha},on:{click:t.refreshCaptcha}})],1),o("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:t.loading,type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.handleLogin(e)}}},[t._v("立即登录 ")])],1)],1)},n=[],s=o("5530"),r=o("e1b8"),i={name:"Login",data:function(){return{loginForm:{username:"18888888888",password:"a111111",captcha:""},loading:!1,passwordType:"password",redirect:void 0,token:"",captcha:""}},watch:{$route:{handler:function(t){this.redirect=t.query&&t.query.redirect},immediate:!0}},created:function(){this.refreshCaptcha()},methods:{refreshCaptcha:function(){var t=this;Object(r["a"])().then((function(e){console.log(e),t.token=e.token,t.captcha=e.captcha}))},showPwd:function(){var t=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){t.$refs.password.focus()}))},handleLogin:function(){var t=this;this.$refs.loginForm.validate((function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,t.$store.dispatch("user/login",Object(s["a"])(Object(s["a"])({},t.loginForm),{},{token:t.token})).then((function(){t.$router.push({path:t.redirect||"/"}),t.loading=!1})).catch((function(){t.loading=!1}))}))}}},c=i,l=(o("2017"),o("0941"),o("2877")),p=Object(l["a"])(c,a,n,!1,null,"69c48c8f",null);e["default"]=p.exports},cafe:function(t,e,o){}}]);