chunk-56d75f01.ac972edd.js 3.9 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-56d75f01"],{5149:function(e,o,t){},6576:function(e,o,t){},"9ed6":function(e,o,t){"use strict";t.r(o);var n=function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("div",{staticClass:"login-container bg-gray-100"},[t("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,autocomplete:"on","label-position":"left"}},[t("div",{staticClass:"title-container flex items-center justify-center"},[t("h3",{staticClass:"title"},[e._v("后台管理")])]),t("el-form-item",{attrs:{prop:"phone"}},[t("span",{staticClass:"svg-container"},[t("svg-icon",{attrs:{"icon-class":"user"}})],1),t("el-input",{ref:"phone",attrs:{placeholder:"手机号码",name:"phone",type:"text",tabindex:"1",autocomplete:"on"},model:{value:e.loginForm.phone,callback:function(o){e.$set(e.loginForm,"phone",o)},expression:"loginForm.phone"}})],1),t("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(o){e.capsTooltip=o},expression:"capsTooltip"}},[t("el-form-item",{attrs:{prop:"password"}},[t("span",{staticClass:"svg-container"},[t("svg-icon",{attrs:{"icon-class":"password"}})],1),t("el-input",{key:e.passwordType,ref:"password",attrs:{type:e.passwordType,placeholder:"密码",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(o){e.capsTooltip=!1}},nativeOn:{keyup:[function(o){return e.checkCapslock(o)},function(o){return!o.type.indexOf("key")&&e._k(o.keyCode,"enter",13,o.key,"Enter")?null:e.handleLogin(o)}]},model:{value:e.loginForm.password,callback:function(o){e.$set(e.loginForm,"password",o)},expression:"loginForm.password"}}),t("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[t("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1)],1),t("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(o){return o.preventDefault(),e.handleLogin(o)}}},[e._v("登录")])],1),t("el-dialog",{attrs:{title:"Or connect with",visible:e.showDialog},on:{"update:visible":function(o){e.showDialog=o}}},[e._v(" Can not be simulated on local, so please combine you own business simulation! ! ! "),t("br"),t("br"),t("br"),t("social-sign")],1)],1)},s=[],i=(t("d9e2"),t("14d9"),t("13d5"),t("b64b"),t("d3b7"),{name:"Login",data:function(){var e=function(e,o,t){o.length<6?t(new Error("密码不能小于6位")):t()};return{loginForm:{phone:"",password:""},loginRules:{phone:[{required:!0,message:"手机号不能为空",trigger:"blur"}],password:[{required:!0,message:"密码不能少于6位",trigger:"blur",validator:e}]},passwordType:"password",capsTooltip:!1,loading:!1,showDialog:!1,redirect:void 0,otherQuery:{}}},watch:{$route:{handler:function(e){var o=e.query;o&&(this.redirect=o.redirect,this.otherQuery=this.getOtherQuery(o))},immediate:!0}},created:function(){},mounted:function(){""===this.loginForm.phone?this.$refs.phone.focus():""===this.loginForm.password&&this.$refs.password.focus()},destroyed:function(){},methods:{checkCapslock:function(e){var o=e.key;this.capsTooltip=o&&1===o.length&&o>="A"&&o<="Z"},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(o){if(!o)return!1;e.loading=!0,e.$store.dispatch("user/login",e.loginForm).then((function(){e.$router.push({path:e.redirect||"/",query:e.otherQuery}),e.loading=!1})).catch((function(){e.loading=!1}))}))},getOtherQuery:function(e){return Object.keys(e).reduce((function(o,t){return"redirect"!==t&&(o[t]=e[t]),o}),{})}}}),r=i,a=(t("ac93"),t("b7c4"),t("2877")),l=Object(a["a"])(r,n,s,!1,null,"2508ab86",null);o["default"]=l.exports},ac93:function(e,o,t){"use strict";t("6576")},b7c4:function(e,o,t){"use strict";t("5149")}}]);