1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2e7998b4"],{"0397":function(e,s,t){},"162f":function(e,s,t){"use strict";t("0397")},"39af":function(e,s,t){"use strict";t("9a92")},"9a92":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),e._v(" "),t("el-dialog",{staticClass:"theAuthDialog",attrs:{visible:e.authVisible,width:"699px","show-close":!1,"destroy-on-close":!0,"close-on-press-escape":!1},on:{"update:visible":function(s){e.authVisible=s}}},[t("TheAuth",{on:{close:function(s){e.authVisible=!1}}})],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 ")])])}],a=t("c7eb"),i=(t("96cf"),t("1da1")),r=(t("61f7"),t("ce96")),l=t("d59f"),c=t("c24f"),u={name:"Login",components:{TheAuth:l["a"]},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{authVisible:!1,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"),this.onAuthError()},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},methods:{onAuthError:function(){var e=Object(i["a"])(Object(a["a"])().mark((function e(){return Object(a["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(c["d"])({});case 3:e.next=9;break;case 5:e.prev=5,e.t0=e["catch"](0),console.log(e.t0),511===e.t0.response.status&&(this.authVisible=!0);case 9:case"end":return e.stop()}}),e,this,[[0,5]])})));function s(){return e.apply(this,arguments)}return s}(),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 r["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}}},d=u,p=(t("162f"),t("39af"),t("2877")),f=Object(p["a"])(d,o,n,!1,null,"7efcd2ea",null);s["default"]=f.exports},d209:function(e,s,t){e.exports=t.p+"static/img/login-logo.fa433576.png"}}]);
|