(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-578404ea"],{"2da8":function(e,n,t){"use strict";var s=t("307c"),a=t.n(s);a.a},"307c":function(e,n,t){},a26d:function(e,n,t){"use strict";t.r(n);var s=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("AccountBox",{attrs:{title:"设备管理员登陆"}},[t("Form",{attrs:{model:e.inputUser,"label-position":"top"}},[t("FormItem",{attrs:{label:""}},[t("Input",{attrs:{disabled:!0,placeholder:""},model:{value:e.inputUser.name,callback:function(n){e.$set(e.inputUser,"name",n)},expression:"inputUser.name"}})],1),t("FormItem",{attrs:{label:"密码"}},[t("Input",{attrs:{type:"password",password:""},on:{"on-enter":e.doLogin},model:{value:e.inputUser.password,callback:function(n){e.$set(e.inputUser,"password",n)},expression:"inputUser.password"}})],1),t("FormItem",[t("Button",{staticClass:"login-btn",attrs:{type:"primary"},on:{click:e.doLogin}},[e._v("登录")])],1)],1),t("TipModal",{ref:"tips"}),t("AskRegisterLoginToken",{ref:"askRLT"})],1)},a=[],o=(t("cc57"),t("5e1d")),r=t("db4b"),i=t("07a4"),c=t("2bcf"),l=t("7a5b"),u=t("ace7"),p=t("6301"),f=t("fb78"),d=t.n(f),h=t("ab66"),m=t("1a8e"),v=t("aa18"),k=t("b2e6"),b=t("c802"),w=t("6700"),g=function(e){function n(){var e;return Object(o["a"])(this,n),e=Object(i["a"])(this,Object(c["a"])(n).apply(this,arguments)),e.inputUser={name:"admin",password:""},e}return Object(l["a"])(n,e),Object(r["a"])(n,[{key:"mounted",value:function(){}},{key:"doLogin",value:function(){var e=new T(this,this.inputUser,"");e.Go()}}]),n}(k["c"]);g=Object(u["a"])([Object(k["a"])({directives:{focus:focus},components:{TipModal:m["a"],AskRegisterLoginToken:v["a"],AccountBox:b["a"]}})],g);var L=g,T=function(){function e(n,t,s){Object(o["a"])(this,e),this.vm=n,this.name=t.name,this.password=t.password,this.rlToken=s,this.resp=["",[],""],p["a"].reflect.BindThisMethods(this)}return Object(r["a"])(e,[{key:"Go",value:function(){var e=this;d.a.waterfall([e.trimInput,e.loginByServer,e.askRegisterLoginToken,e.reportError,e.frontendLogin],(function(n,t){e._showFinalError(n,t)}))}},{key:"_showFinalError",value:function(e,n){var t=this;t.vm.$refs.tips.clearAndCloseTips(),e&&"cancel"!==e&&t.vm.$refs.tips.showErrorModal("登录失败",e)}},{key:"trimInput",value:function(e){this.name=this.name.trim(),this.password=this.password.trim(),e(null)}},{key:"loginByServer",value:function(e){var n=this;p["a"].rpc.Client.Login(this.name,this.password,this.rlToken,"",(function(t){console.log("client.Login: ",t),n.resp=t,e(null)}),(function(n){e(n)}))}},{key:"askRegisterLoginToken",value:function(n){var t=this.resp[2];if(""!==t)if(t.indexOf("NeedRegisterLoginToken")<0)n(null);else{var s=this;this.vm.$refs.askRLT.onOK=function(){var t=s.vm.$refs.askRLT.getToken(),a=new e(s.vm,{name:s.name,password:s.password},t);a.Go(),n("cancel")},this.vm.$refs.askRLT.onCancel=function(){n("cancel")},this.vm.$refs.askRLT.showModal()}else n(null)}},{key:"reportError",value:function(e){var n=this.resp[2];e(n)}},{key:"frontendLogin",value:function(e){var n=this.resp[1];if(n&&1===n.length){var t=this.resp[0],s=h["u"].FromSample(n[0]),a=new w["b"](this.vm,t,s,this.name);a.Go()}e(null)}}]),e}(),y=L,O=(t("2da8"),t("5511")),j=Object(O["a"])(y,s,a,!1,null,"2d3f73bb",null);n["default"]=j.exports}}]);