chunk-670da3bb.87e7da12.js 5.1 KB

123456
  1. /*!
  2. * build: Hopaheal
  3. * copyright: Mead
  4. * time: 2022-6-7 11:38:49
  5. */
  6. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-670da3bb"],{"8f0e":function(e,t,r){},"9ed6":function(e,t,r){"use strict";r.r(t);var s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"login-container"},[r("el-row",[r("el-col",{attrs:{lg:14,md:11,sm:24,xl:14,xs:24}},[r("div",{staticStyle:{color:"transparent"}},[e._v("占位符")])]),r("el-col",{attrs:{lg:9,md:12,sm:24,xl:9,xs:24}},[r("el-form",{ref:"form",staticClass:"login-form",attrs:{"label-position":"left",model:e.form,rules:e.rules}},[r("div",{staticClass:"title"},[e._v("本草,你好 !")]),r("div",{staticClass:"title-tips"},[e._v("欢迎来到"+e._s(e.title)+"!")]),r("el-form-item",{staticStyle:{"margin-top":"40px"},attrs:{prop:"username"}},[r("el-input",{directives:[{name:"focus",rawName:"v-focus"}],attrs:{placeholder:"请输入用户名",tabindex:"1",type:"text"},scopedSlots:e._u([{key:"prefix",fn:function(){return[r("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),r("el-form-item",{attrs:{prop:"password"}},[r("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[r("vab-icon",{attrs:{icon:"lock-line"}})]},proxy:!0},"password"===e.passwordType?{key:"suffix",fn:function(){return[r("vab-icon",{staticClass:"show-password",attrs:{icon:"eye-off-line"},on:{click:e.handlePassword}})]},proxy:!0}:{key:"suffix",fn:function(){return[r("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),r("div",{staticClass:"youKe"},[r("el-button",{staticClass:"login-btn",attrs:{loading:e.loading,type:"primary"},on:{click:e.handleLogin}},[e._v(" 登录 ")]),r("el-button",{staticClass:"login-test",attrs:{type:"warning"},on:{click:e.handleTest}},[e._v(" 游客登录 ")])],1),r("div",{staticClass:"tips"},[e._v(" 本系统为演示系统,请勿提交真实数据,正式系统随后开放。 ")])],1)],1),r("el-col",{attrs:{lg:1,md:1,sm:24,xl:1,xs:24}},[r("div",{staticStyle:{color:"transparent"}},[e._v("占位符")])])],1)],1)},n=[],a=r("1da1"),o=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(o["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(o["a"])(Object(o["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()}))},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(a["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:btoa(JSON.stringify(e.form))},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(a["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:btoa(JSON.stringify(e.form))},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("a642"),r("2877")),p=Object(d["a"])(u,s,n,!1,null,"a78d26d6",null);t["default"]=p.exports},a642:function(e,t,r){"use strict";r("8f0e")}}]);