You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
6.7 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-00369512"],{4066:function(t,o,e){t.exports=e.p+"static/img/copyright.79c5518b.jpg"},4843:function(t,o,e){"use strict";e("d92a")},"83a3":function(t,o,e){t.exports=e.p+"static/img/loginbg.361c47f3.png"},"9ed6":function(t,o,e){"use strict";e.r(o);var n=function(){var t=this,o=t.$createElement,n=t._self._c||o;return n("div",{staticClass:"login-container"},[n("div",{staticClass:"loginCard"},[t._m(0),n("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:t.loginForm,rules:t.loginRules,autocomplete:"on","label-position":"left"}},[t.authCode?n("div",[n("div",{staticClass:"title-container"},[n("img",{attrs:{src:e("cf05"),alt:""}}),n("h2",{staticClass:"title"},[t._v("请输入短信验证码!")])]),n("el-form-item",{attrs:{prop:"code"}},[n("el-input",{ref:"code",attrs:{placeholder:"请输入验证码",name:"code",type:"text",tabindex:"1",autocomplete:"on"},model:{value:t.code,callback:function(o){t.code=o},expression:"code"}})],1),n("h5",{staticClass:"desc"},[n("span",[t._v(" 验证码已发送至"+t._s(t.phone.replace(t.phone.substr(3,4),"****"))+",没有收到? ")]),n("el-link",{attrs:{type:"primary"},on:{click:function(o){return t.handleLogin("cooldownFlag")}}},[n("span",[t._v("再次发送")]),t.cooldown>0?n("span",[t._v("("+t._s(t.cooldown)+" s)")]):t._e()]),n("el-link",{staticStyle:{"margin-left":"10px"},attrs:{type:"primary"},on:{click:function(o){t.authCode=!1}}},[n("span",[t._v("切换账号")])])],1)],1):n("div",[n("div",{staticClass:"title-container"},[n("img",{attrs:{src:e("cf05"),alt:""}}),n("h2",{staticClass:"title"},[t._v("欢迎您登录!")])]),n("el-form-item",{attrs:{prop:"account"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{"icon-class":"user"}})],1),n("el-input",{ref:"account",attrs:{placeholder:"用户名",name:"account",type:"text",tabindex:"1",autocomplete:"on"},model:{value:t.loginForm.account,callback:function(o){t.$set(t.loginForm,"account",o)},expression:"loginForm.account"}})],1),n("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:t.capsTooltip,callback:function(o){t.capsTooltip=o},expression:"capsTooltip"}},[n("el-form-item",{attrs:{prop:"password"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{"icon-class":"password"}})],1),n("el-input",{key:t.passwordType,ref:"password",attrs:{type:t.passwordType,placeholder:"密码",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(o){t.capsTooltip=!1}},nativeOn:{keyup:[function(o){return t.checkCapslock(o)},function(o){return!o.type.indexOf("key")&&t._k(o.keyCode,"enter",13,o.key,"Enter")?null:t.handleLogin(o)}]},model:{value:t.loginForm.password,callback:function(o){t.$set(t.loginForm,"password",o)},expression:"loginForm.password"}}),n("span",{staticClass:"show-pwd",on:{click:t.showPwd}},[n("svg-icon",{attrs:{"icon-class":"password"===t.passwordType?"eye":"eye-open"}})],1)],1)],1)],1),n("el-button",{staticClass:"loginBtn",attrs:{loading:t.loading},nativeOn:{click:function(o){return o.preventDefault(),t.handleLogin(o)}}},[t._v(" 登录 ")])],1)],1),n("img",{staticStyle:{display:"none"},attrs:{src:e("4066")}})])},s=[function(){var t=this,o=t.$createElement,n=t._self._c||o;return n("div",{staticClass:"login-sidebox"},[n("div",{staticClass:"login-sidebox__title"},[n("h2",[t._v("HuoCMS")]),n("p",[t._v("高性能 / 精致 / 优雅")]),n("p",[t._v("多语言,多站点,强大的SEO功能")])]),n("img",{attrs:{src:e("83a3")}})])}],i=(e("14d9"),e("13d5"),e("d3b7"),e("b64b"),e("c24f")),a={name:"Login",data:function(){return{authCode:!1,phone:"",code:"",cooldownFlag:!1,cooldown:0,loginForm:{account:"",password:""},loginRules:{account:[{required:"true",message:"请输入用户名",trigger:"blur"}],password:[{required:"true",message:"请输入密码",trigger:"blur"}]},passwordType:"password",capsTooltip:!1,loading:!1,showDialog:!1,redirect:void 0,otherQuery:{},publicKey:"-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC5Bxjyw7r9IW08OMudzn0M9CBu3dvKtNOtbMuN7iEQPEosUMbfk3vpi8vX7pdGKHnzUZ47yh44FTcDyoBbOG+NseuTrirkdGCvXyTZyfAZ9TQ/FFBVG1cemoeA5/ry1PMMw6V6EGK8hBL6h/WWZTnksWiWvmLzneQyYphcL1UpKQIDAQAB-----END PUBLIC KEY-----"}},watch:{},mounted:function(){""===this.loginForm.account?this.$refs.account.focus():""===this.loginForm.password&&this.$refs.password.focus()},methods:{encrypt:function(t){var o=new this.$jsEncrypt;return o.setPublicKey(this.publicKey),o.encrypt(t)},cooldownTime:function(){var t=this;this.cooldown=60;var o=setInterval((function(){t.cooldown--,t.cooldown<=0&&clearInterval(o)}),1e3)},checkCapslock:function(t){var o=t.key;this.capsTooltip=o&&1===o.length&&o>="A"&&o<="Z"},showPwd:function(){var t=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){t.$refs.password.focus()}))},getUserInfo:function(){Object(i["d"])().then((function(t){}))},handleLogin:function(){var t=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";"cooldownFlag"==o&&this.cooldown>0?this.$message.warning("请在"+this.cooldown+"秒之后再发送验证码!"):"cooldownFlag"!=o&&this.authCode?this.checkCode():this.$refs.loginForm.validate((function(e){if(!e)return!1;var n=new t.$jsEncrypt;n.setPublicKey(t.publicKey);var s={account:t.encrypt(t.loginForm.account),password:t.encrypt(t.loginForm.password)};t.loading=!0,t.$store.dispatch("user/login",s).then((function(e){if("code_auth"==e.msg)return t.authCode=!0,t.phone=e.data.phone,t.loading=!1,void("cooldownFlag"==o&&t.cooldownTime());e.data.token&&(t.$store.dispatch("user/dynamicRoutes"),t.$store.dispatch("user/getCurrent"),t.$store.dispatch("user/generateRoutes").then((function(o){var e,n,s,i=o;t.$router.push({path:t.redirect||(null===(e=i[0])||void 0===e?void 0:e.path)||(null===(n=i[0])||void 0===n||null===(n=n.children[0])||void 0===n?void 0:n.path)||(null===(s=i[0])||void 0===s||null===(s=s.children[0])||void 0===s||null===(s=s.children[0])||void 0===s?void 0:s.path),query:t.otherQuery})})),t.$message.success(e.msg)),t.loading=!1})).catch((function(){t.loading=!1}))}))},checkCode:function(){var t=this;this.loading=!0;var o={phone:this.encrypt(this.phone),code:this.encrypt(this.code)};this.$store.dispatch("user/authCode",o).then((function(o){o.data.token?(t.$router.push({path:t.redirect||"/",query:t.otherQuery}),t.loading=!1,t.$message.success(o.msg)):(t.loading=!1,t.code="")})).catch((function(){t.loading=!1}))},getOtherQuery:function(t){return Object.keys(t).reduce((function(o,e){return"redirect"!==e&&(o[e]=t[e]),o}),{})}}},c=a,r=(e("4843"),e("f811"),e("2877")),l=Object(r["a"])(c,n,s,!1,null,"2b1a6c4b",null);o["default"]=l.exports},cd79:function(t,o,e){},cf05:function(t,o,e){t.exports=e.p+"static/img/logo.ea4fd7c6.png"},d92a:function(t,o,e){},f811:function(t,o,e){"use strict";e("cd79")}}]);