4.c8c6075091fceb8a06dd.js 5.6 KB

1
  1. webpackJsonp([4],{"7Otq":function(n,e,t){n.exports=t.p+"static/img/logo.8c5189d.png"},"T+/8":function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=t("7Otq"),i=t.n(o),a={name:"login",data:function(){return{loginForm:{username:"",password:""},loginRules:{username:[{required:!0,trigger:"blur",message:"请输入用户名"},{min:5,max:20,trigger:"blur",message:"用户名长度在 5 到 20 个字符"}],password:[{required:!0,trigger:"blur",message:"请输入密码"},{min:5,max:20,trigger:"blur",message:"密码长度在 5 到 20 个字符"}]},passwordType:"password",loading:!1,showDialog:!1,logo:i.a}},methods:{showPwd:function(){"password"===this.passwordType?this.passwordType="text":this.passwordType="password"},handleLogin:function(){var n=this;this.$refs.loginForm.validate(function(e){if(!e)return console.log("error submit!!"),!1;n.loading=!0,n.$store.dispatch("login",{username:n.loginForm.username,password:n.loginForm.password}).then(function(e){n.$store.dispatch("auth").then(function(e){n.loading=!1,n.$router.push({path:"/"})}).catch(function(e){console.log(e),n.loading=!1})}).catch(function(){n.loading=!1})})}}},s={render:function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"login-container"},[t("el-row",{staticStyle:{height:"100%"},attrs:{gutter:0,type:"flex",justify:"center",align:"middle"}},[t("el-col",{attrs:{xs:18,sm:10,md:10,lg:6,xl:6}},[t("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{autoComplete:"on","label-position":"left",model:n.loginForm,rules:n.loginRules,"status-icon":!0}},[t("img",{attrs:{src:n.logo,width:"100%"}}),n._v(" "),t("el-form-item",{attrs:{prop:"username"}},[t("span",{staticClass:"svg-container svg-container_login"},[t("svg-icon",{attrs:{"icon-class":"user"}})],1),n._v(" "),t("el-input",{attrs:{name:"username",type:"text",autoComplete:"on",placeholder:"username"},model:{value:n.loginForm.username,callback:function(e){n.$set(n.loginForm,"username",e)},expression:"loginForm.username"}})],1),n._v(" "),t("el-form-item",{attrs:{prop:"password"}},[t("span",{staticClass:"svg-container"},[t("svg-icon",{attrs:{"icon-class":"password"}})],1),n._v(" "),t("el-input",{attrs:{name:"password",type:n.passwordType,autoComplete:"on",placeholder:"password"},nativeOn:{keyup:function(e){if(!("button"in e)&&n._k(e.keyCode,"enter",13,e.key))return null;n.handleLogin(e)}},model:{value:n.loginForm.password,callback:function(e){n.$set(n.loginForm,"password",e)},expression:"loginForm.password"}}),n._v(" "),t("span",{staticClass:"svg-container show-pwd",on:{click:n.showPwd}},[t("svg-icon",{attrs:{"icon-class":"password"===n.passwordType?"eye_close":"eye_open"}})],1)],1),n._v(" "),t("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{type:"primary",loading:n.loading},nativeOn:{click:function(e){e.preventDefault(),n.handleLogin(e)}}},[n._v("登录")])],1)],1)],1)],1)},staticRenderFns:[]};var r=t("VU/8")(a,s,!1,function(n){t("rISL"),t("p0By")},"data-v-1025c768",null);e.default=r.exports},bp1X:function(n,e,t){(n.exports=t("FZ+f")(!1)).push([n.i,"/* reset element-ui css */\n.login-container .el-input {\n display: inline-block;\n height: 47px;\n width: 80%;\n}\n.login-container .el-input input {\n font-size: 16px;\n background: transparent;\n border: 0px;\n -webkit-appearance: none;\n border-radius: 0px;\n padding: 12px 5px 15px;\n color: #eee;\n height: 47px;\n}\n.login-container .el-input input:-webkit-autofill {\n -webkit-box-shadow: 0 0 0px 1000px #2d3a4b inset !important;\n box-shadow: 0 0 0px 1000px #2d3a4b inset !important;\n -webkit-text-fill-color: #fff !important;\n}\n.login-container .el-form-item {\n border: 1px solid rgba(255, 255, 255, 0.1);\n background: rgba(0, 0, 0, 0.1);\n border-radius: 5px;\n color: #454545;\n}\n.login-container .el-form-item__content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n",""])},inUK:function(n,e,t){(n.exports=t("FZ+f")(!1)).push([n.i,"\n.login-container[data-v-1025c768] {\n position: fixed;\n height: 100%;\n width: 100%;\n background-color: #2d3a4b;\n}\n.login-container .login-form[data-v-1025c768] {\n margin-top: -50%;\n}\n.login-container .svg-container[data-v-1025c768] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 100%;\n color: #889aa4;\n width: 10%;\n}\n.login-container .svg-container_login[data-v-1025c768] {\n font-size: 20px;\n}\n.login-container .title-container[data-v-1025c768] {\n position: relative;\n}\n.login-container .title-container .title[data-v-1025c768] {\n font-size: 26px;\n font-weight: 400;\n color: #eee;\n margin: 0px auto 40px auto;\n text-align: center;\n font-weight: bold;\n}\n.login-container .show-pwd[data-v-1025c768] {\n font-size: 18px;\n color: #889aa4;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.login-container .thirdparty-button[data-v-1025c768] {\n position: absolute;\n right: 35px;\n bottom: 28px;\n}\n",""])},p0By:function(n,e,t){var o=t("inUK");"string"==typeof o&&(o=[[n.i,o,""]]),o.locals&&(n.exports=o.locals);t("rjj0")("3d85f2a4",o,!0)},rISL:function(n,e,t){var o=t("bp1X");"string"==typeof o&&(o=[[n.i,o,""]]),o.locals&&(n.exports=o.locals);t("rjj0")("f6363218",o,!0)}});