chunk-342b0016.f338ece3.js 4.4 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-342b0016"],{"42b4":function(e,s,t){"use strict";t("901e")},"4b1f":function(e,s,t){"use strict";t("a520")},"901e":function(e,s,t){},"9ed6":function(e,s,t){"use strict";t.r(s);var o=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"login-container"},[e._m(0),e._v(" "),t("div",{staticClass:"login-section"},[t("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,"auto-complete":"on","label-position":"left"}},[t("div",{staticClass:"title-container"},[e._v("登录")]),e._v(" "),t("el-form-item",{staticClass:"logitem",attrs:{prop:"username"}},[t("span",{staticClass:"svg-container"},[t("svg-icon",{attrs:{"icon-class":"user"}})],1),e._v(" "),t("el-input",{ref:"username",staticClass:"login-input",attrs:{placeholder:"请输入用户名",name:"username",type:"text",tabindex:"1","auto-complete":"off"},nativeOn:{keyup:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.handleLogin(s)}},model:{value:e.loginForm.username,callback:function(s){e.$set(e.loginForm,"username","string"===typeof s?s.trim():s)},expression:"loginForm.username"}})],1),e._v(" "),t("el-form-item",{staticClass:"logitem",attrs:{prop:"password"}},[t("span",{staticClass:"svg-container"},[t("svg-icon",{attrs:{"icon-class":"password"}})],1),e._v(" "),t("el-input",{key:e.passwordType,ref:"password",staticClass:"login-input",attrs:{type:e.passwordType,placeholder:"请输入密码",name:"password",tabindex:"2","auto-complete":"off"},nativeOn:{keyup:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.handleLogin(s)}},model:{value:e.loginForm.password,callback:function(s){e.$set(e.loginForm,"password","string"===typeof s?s.trim():s)},expression:"loginForm.password"}}),e._v(" "),t("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[t("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1),e._v(" "),t("div",{staticClass:"remberBox",on:{click:function(s){e.isSaveUserInfo=!e.isSaveUserInfo}}},[t("div",{staticClass:"dotWrap",class:[e.isSaveUserInfo?"checked":""]}),e._v("\n 记住密码\n ")]),e._v(" "),t("div",{staticClass:"loginBtn",class:e.loginForm.username&&e.loginForm.password?"":"disabled",on:{click:e.handleLogin}},[e._v("\n 登录\n ")])],1)],1)])},n=[function(){var e=this,s=e.$createElement,o=e._self._c||s;return o("div",{staticClass:"login-left"},[o("div",{staticClass:"login-header"},[o("div",{staticClass:"logo"},[o("img",{attrs:{src:t("d209"),alt:""}})]),e._v(" "),o("i",{staticClass:"line"}),e._v(" "),o("div",{staticClass:"logo-name"},[e._v("乐团管理系统")])]),e._v(" "),o("div",{staticClass:"footer"},[e._v("\n Copyright © 2022 管乐迷, Inc.ALL Rights Reserved\n ")])])}],i=(t("61f7"),t("ce96")),a={name:"Login",data:function(){var e=function(e,s,t){s?t():t(new Error("请输入用户名"))},s=function(e,s,t){s.length<6?t(new Error("密码必须大于六位")):t()};return{loginForm:{username:"",password:""},loginRules:{username:[{required:!0,trigger:"blur",validator:e}],password:[{required:!0,trigger:"blur",validator:s}]},passwordType:"password",redirect:void 0,isSaveUserInfo:!0}},mounted:function(){this.loginForm.username=localStorage.getItem("username"),this.loginForm.password=localStorage.getItem("password")},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},methods:{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,s=new i["a"];s.removeAll(),this.isSaveUserInfo?(localStorage.setItem("username",this.loginForm.username),localStorage.setItem("password",this.loginForm.password)):(localStorage.setItem("username",""),localStorage.setItem("password","")),this.$refs.loginForm.validate((function(s){if(!s)return!1;e.$store.dispatch("user/login",e.loginForm).then((function(s){e.$nextTick((function(s){e.$store.dispatch("delAllViews"),e.$router.push({path:"/workbench"})}))})).catch((function(){}))}))},saveUserInfo:function(){this.isSaveUserInfo=!this.isSaveUserInfo}}},r=a,l=(t("4b1f"),t("42b4"),t("2877")),c=Object(l["a"])(r,o,n,!1,null,"ecf2b20a",null);s["default"]=c.exports},a520:function(e,s,t){},d209:function(e,s,t){e.exports=t.p+"static/img/login-logo.fa433576.png"}}]);