blob: 6160478489382c89b7ffb1a098b283ab582ab737 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["login"],{2017:function(e,t,n){"use strict";var a=n("25ae"),s=n.n(a);s.a},"25ae":function(e,t,n){e.exports={menuBg:"#304156",menuText:"#bfcbd9",menuActiveText:"#409eff"}},"2c57":function(e,t,n){},"2feb":function(e,t,n){"use strict";var a=n("2c57"),s=n.n(a);s.a},"38eb":function(e,t,n){"use strict";var a=n("55c6"),s=n.n(a);s.a},"55c6":function(e,t,n){},"9ed6":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"login-container"},[n("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,autocomplete:"on","label-position":"left"}},[n("div",{staticClass:"title-container"},[n("h3",{staticClass:"title"},[e._v("\n "+e._s(e.$t("login.title"))+"\n ")])]),n("el-form-item",{attrs:{prop:"username"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{name:"user"}})],1),n("el-input",{ref:"username",attrs:{placeholder:e.$t("login.username"),name:"username",type:"text",autocomplete:"on"},model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}})],1),n("el-form-item",{attrs:{prop:"password"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{name:"password"}})],1),n("el-input",{key:e.passwordType,ref:"password",attrs:{type:e.passwordType,placeholder:e.$t("login.password"),name:"password",autocomplete:"on"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}}),n("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[n("svg-icon",{attrs:{name:"password"===e.passwordType?"eye-off":"eye-on"}})],1)],1),n("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e._v("\n "+e._s(e.$t("login.logIn"))+"\n ")])],1),n("el-dialog",{attrs:{title:e.$t("login.thirdparty"),visible:e.showDialog},on:{"update:visible":function(t){e.showDialog=t}}},[e._v("\n "+e._s(e.$t("login.thirdpartyTips"))+"\n "),n("br"),n("br"),n("br"),n("social-sign")],1)],1)},s=[],r=(n("ac6a"),n("456d"),n("96cf"),n("3b8d")),o=n("d225"),i=n("b0b4"),c=n("308d"),l=n("6bb5"),u=n("4e2b"),d=n("9ab4"),p=n("60a3"),g=n("9dba"),f=n("75fb"),m=n("1131"),h=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"social-signup-container"},[n("div",{staticClass:"sign-btn",on:{click:function(t){return e.wechatHandleClick("wechat")}}},[n("span",{staticClass:"wx-svg-container"},[n("svg-icon",{staticClass:"icon",attrs:{name:"wechat"}})],1),e._v(" 微信\n ")]),n("div",{staticClass:"sign-btn",on:{click:function(t){return e.tencentHandleClick("tencent")}}},[n("span",{staticClass:"qq-svg-container"},[n("svg-icon",{staticClass:"icon",attrs:{name:"qq"}})],1),e._v(" QQ\n ")])])},v=[],b=function(e){function t(){return Object(o["a"])(this,t),Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments))}return Object(u["a"])(t,e),Object(i["a"])(t,[{key:"wechatHandleClick",value:function(e){alert("ok")}},{key:"tencentHandleClick",value:function(e){alert("ok")}}]),t}(p["c"]);b=d["a"]([Object(p["a"])({name:"SocialSignin"})],b);var w=b,y=w,k=(n("2feb"),n("2877")),O=Object(k["a"])(y,h,v,!1,null,"49c412dc",null),C=O.exports,j=function(e){function t(){var e;return Object(o["a"])(this,t),e=Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.validateUsername=function(e,t,n){Object(f["c"])(t)?n():n(new Error("Please enter the correct user name"))},e.validatePassword=function(e,t,n){t.length<6?n(new Error("The password can not be less than 6 digits")):n()},e.loginForm={username:"admin",password:"111111"},e.loginRules={username:[{validator:e.validateUsername,trigger:"blur"}],password:[{validator:e.validatePassword,trigger:"blur"}]},e.passwordType="password",e.loading=!1,e.showDialog=!1,e.otherQuery={},e}return Object(u["a"])(t,e),Object(i["a"])(t,[{key:"onRouteChange",value:function(e){var t=e.query;t&&(this.redirect=t.redirect,this.otherQuery=this.getOtherQuery(t))}},{key:"mounted",value:function(){""===this.loginForm.username?this.$refs.username.focus():""===this.loginForm.password&&this.$refs.password.focus()}},{key:"showPwd",value:function(){var e=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){e.$refs.password.focus()}))}},{key:"handleLogin",value:function(){var e=this;this.$refs.loginForm.validate(function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=8;break}return e.loading=!0,t.next=4,g["a"].Login(e.loginForm);case 4:e.$router.push({path:e.redirect||"/",query:e.otherQuery}),setTimeout((function(){e.loading=!1}),500),t.next=9;break;case 8:return t.abrupt("return",!1);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"getOtherQuery",value:function(e){return Object.keys(e).reduce((function(t,n){return"redirect"!==n&&(t[n]=e[n]),t}),{})}}]),t}(p["c"]);d["a"]([Object(p["d"])("$route",{immediate:!0})],j.prototype,"onRouteChange",null),j=d["a"]([Object(p["a"])({name:"Login",components:{LangSelect:m["a"],SocialSign:C}})],j);var $=j,x=$,F=(n("2017"),n("38eb"),Object(k["a"])(x,a,s,!1,null,"72a1b6ee",null));t["default"]=F.exports}}]);