/*! * build: Hopaheal * copyright: Mead * time: 2022-8-18 15:39:42 */ (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-719cea3f"],{"2d98":function(e,t,r){"use strict";r("b7cd")},"9ed6":function(e,t,r){"use strict";r.r(t);var s=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"login-container"},[s("img",{staticClass:"bg-image",attrs:{alt:"",src:r("e458"),srcset:""}}),s("el-row",[s("el-col",{attrs:{lg:14,md:11,sm:24,xl:14,xs:24}},[s("div",{staticClass:"title"},[e._v(e._s(e.title))]),s("div",{staticStyle:{color:"transparent"}},[e._v("占位符")])]),s("el-col",{attrs:{lg:9,md:12,sm:24,xl:9,xs:24}},[s("el-form",{ref:"form",staticClass:"login-form",attrs:{"label-position":"left",model:e.form,rules:e.rules}},[s("div",{staticClass:"title-tips"},[e._v("登录")]),s("el-form-item",{staticStyle:{"margin-top":"40px"},attrs:{prop:"username"}},[s("el-input",{directives:[{name:"focus",rawName:"v-focus"}],attrs:{placeholder:"请输入用户名",tabindex:"1",type:"text"},scopedSlots:e._u([{key:"prefix",fn:function(){return[s("vab-icon",{attrs:{icon:"user-line"}})]},proxy:!0}]),model:{value:e.form.username,callback:function(t){e.$set(e.form,"username","string"===typeof t?t.trim():t)},expression:"form.username"}})],1),s("el-form-item",{attrs:{prop:"password"}},[s("el-input",{key:e.passwordType,ref:"password",attrs:{placeholder:"请输入密码",tabindex:"2",type:e.passwordType},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin.apply(null,arguments)}},scopedSlots:e._u([{key:"prefix",fn:function(){return[s("vab-icon",{attrs:{icon:"lock-line"}})]},proxy:!0},"password"===e.passwordType?{key:"suffix",fn:function(){return[s("vab-icon",{staticClass:"show-password",attrs:{icon:"eye-off-line"},on:{click:e.handlePassword}})]},proxy:!0}:{key:"suffix",fn:function(){return[s("vab-icon",{staticClass:"show-password",attrs:{icon:"eye-line"},on:{click:e.handlePassword}})]},proxy:!0}],null,!0),model:{value:e.form.password,callback:function(t){e.$set(e.form,"password","string"===typeof t?t.trim():t)},expression:"form.password"}})],1),s("div",{staticClass:"youKe"},[s("el-button",{staticClass:"login-btn",attrs:{loading:e.loading,type:"primary"},on:{click:e.handleLogin}},[e._v(" 登录 ")])],1),s("div",{staticClass:"bottom-text"},[s("div",{staticClass:"apply-account",on:{click:e.loginAccount}},[s("vab-icon",{attrs:{icon:"account-circle-line"}}),e._v(" 申请帐号 ")],1),s("div",{staticClass:"get-pwd",on:{click:e.handleReset}},[s("vab-icon",{attrs:{icon:"question-line"}}),e._v(" 找回密码 ")],1)])],1)],1),s("el-col",{attrs:{lg:1,md:1,sm:24,xl:1,xs:24}},[s("div",{staticStyle:{color:"transparent"}},[e._v("占位符")])])],1)],1)},n=[],o=r("1da1"),a=r("5530"),i=(r("96cf"),r("d9e2"),r("0eb6"),r("b7ef"),r("8bd4"),r("e9c4"),r("2f62")),c=r("61f7"),l={name:"Login",directives:{focus:{inserted:function(e){e.querySelector("input").focus()}}},beforeRouteLeave:function(e,t,r){clearInterval(this.timer),r()},data:function(){var e=function(e,t,r){""===t?r(new Error("用户名不能为空")):r()},t=function(e,t,r){Object(c["isPassword"])(t)?r():r(new Error("密码不能少于6位"))};return{form:{username:"",password:""},rules:{username:[{required:!0,trigger:"blur",validator:e}],password:[{required:!0,trigger:"blur",validator:t}]},loading:!1,passwordType:"password",redirect:void 0,timer:0,codeUrl:"https://www.oschina.net/action/user/captcha",previewText:""}},computed:Object(a["a"])({},Object(i["c"])({title:"settings/title"})),watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect||"/"},immediate:!0}},mounted:function(){this.form.username="",this.form.password=""},methods:Object(a["a"])(Object(a["a"])({},Object(i["b"])({login:"user/login",setAvatar:"user/setAvatar",setRole_id:"user/setRole_id"})),{},{handlePassword:function(){var e=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){e.$refs.password.focus()}))},handleReset:function(){this.$router.push({path:"/login/reset"})},loginAccount:function(){this.$router.push({path:"/login/account"})},handleRoute:function(){return console.log(this.redirect,"this.redirect"),"/404"===this.redirect||"/403"===this.redirect?"/":this.redirect},handleLogin:function(){var e=this;this.$refs.form.validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(r){var s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=11;break}return t.prev=1,e.loading=!0,s={username:e.form.username,password:btoa(e.form.password)},t.next=6,e.login(s);case 6:return t.next=8,e.$router.push(e.handleRoute());case 8:return t.prev=8,e.loading=!1,t.finish(8);case 11:case"end":return t.stop()}}),t,null,[[1,,8,11]])})));return function(e){return t.apply(this,arguments)}}())},handleTest:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.form={username:"test",password:"123456"},r={username:e.form.username,password:btoa(JSON.stringify(e.form.password))},t.next=4,e.login(r);case 4:return t.next=6,e.$router.push(e.handleRoute());case 6:case"end":return t.stop()}}),t)})))()},changeCode:function(){this.codeUrl="https://www.oschina.net/action/user/captcha?timestamp=".concat((new Date).getTime())}})},u=l,d=(r("2d98"),r("2877")),p=Object(d["a"])(u,s,n,!1,null,"1d33a6c8",null);t["default"]=p.exports},b7cd:function(e,t,r){},e458:function(e,t,r){e.exports=r.p+"static/img/login-icon.cd77eda5.png"}}]);