(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-db822396"],{"00dd":function(e,t,o){"use strict";o("dd35")},2017:function(e,t,o){"use strict";o("cafe")},"9ed6":function(e,t,o){"use strict";o.r(t);var n=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"login-container"},[o("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{"status-icon":"",model:e.loginForm,rules:e.loginRules}},[o("div",{staticClass:"title-container"},[o("h3",{staticClass:"title"},[e._v("微店后台管理系统")])]),o("el-form-item",{attrs:{prop:"name"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"user-icon"}})],1),o("el-input",{ref:"name",attrs:{placeholder:"用户名",name:"name",type:"text",tabindex:"1",autocomplete:"on"},model:{value:e.loginForm.name,callback:function(t){e.$set(e.loginForm,"name",t)},expression:"loginForm.name"}})],1),o("el-tooltip",{attrs:{content:"键盘大写锁定已打开",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[o("el-form-item",{attrs:{prop:"password"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"password"}})],1),o("el-input",{key:e.passwordType,ref:"password",attrs:{type:e.passwordType,placeholder:"密码",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(t){e.capsTooltip=!1}},nativeOn:{keyup:[function(t){return e.checkCapslock(t)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}]},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}}),o("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[o("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1)],1),o("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e._v("登录")])],1),o("div",{staticClass:"beian"},[e._v("豫ICP备19034874号-1")])],1)},r=[],s=(o("b64b"),{name:"Login",data:function(){return{loginForm:{name:"",password:""},loginRules:{name:[{required:!0,trigger:"change",validator:function(e,t,o){return t.length>1?o():o(new Error("用户名不能小于2位"))}}],password:[{required:!0,trigger:"change",validator:function(e,t,o){return t.length>5?o():o(new Error("密码不能小于6位"))}}]},passwordType:"password",capsTooltip:!1,loading:!1,redirect:void 0,otherQuery:{}}},watch:{$route:{handler:function(e){var t=e.query;t&&(this.redirect=t.redirect,this.otherQuery=Object.keys(t).reduce((function(e,o){return"redirect"!==o&&(e[o]=t[o]),e}),{}))},immediate:!0}},mounted:function(){},methods:{checkCapslock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.shiftKey,o=e.key;o&&1===o.length&&(this.capsTooltip=!!(t&&o>="a"&&o<="z"||!t&&o>="A"&&o<="Z")),"CapsLock"===o&&!0===this.capsTooltip&&(this.capsTooltip=!1)},showPwd:function(){var e=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){e.$refs.password.focus()}))},handleLogin:function(){var e=this;this.$refs.loginForm.validate((function(t){if(!t)return!1;e.loading=!0,e.$store.dispatch("user/login",e.loginForm).then((function(t){if(23===t.role_id)return e.$router.push({path:e.redirect||"/store/store",query:e.otherQuery}),!1;e.$router.push({path:e.redirect||"/",query:e.otherQuery}),e.loading=!1})).catch((function(t){e.$message.error(t),e.loading=!1}))}))}}}),i=s,a=(o("2017"),o("00dd"),o("2877")),c=Object(a["a"])(i,n,r,!1,null,"1cb15eb0",null);t["default"]=c.exports},cafe:function(e,t,o){},dd35:function(e,t,o){}}]);